mltable provides Python APIs for creating, loading, and managing the MLTable data format, a declarative and standardized way to define data for machine learning workloads. It is particularly used within Azure Machine Learning to specify datasets from various sources like local files, Delta Lake, Parquet, and CSV. The current version is 1.6.3, and it generally follows a regular release cadence.
pip install mltableVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create an MLTable from local JSON Lines files, save it to a directory, and then load it back. Finally, it converts the loaded MLTable into a Pandas DataFrame for easy viewing. This is a common pattern for defining and managing datasets.
Prefix local paths with `file://` (e.g., `mltable.from_json_lines_files(files=['file://./data.jsonl'])`) or ensure your execution environment correctly resolves relative paths for `MLTable` operations.
Carefully review the official MLTable schema documentation. Use a YAML linter if authoring MLTable files manually. Ensure all required fields like `paths` and `transformations` (if applicable) are correctly defined.
Install necessary storage-specific packages (e.g., `pip install mltable[azure]`). Ensure your environment has valid Azure credentials (e.g., via environment variables, Azure CLI login, or managed identity). Refer to `azure-identity` documentation for credential setup.
Run `pip install mltable` in your active Python environment.
Verify that the path provided to `mltable.load()` or within the MLTable definition points to an existing directory or file. Ensure correct casing and full paths if not using URIs. Check file permissions.
Inspect the `MLTable` file for syntax errors (e.g., indentation, missing colons) and ensure it includes all required fields and adheres to the official MLTable schema for its version. The error message usually provides more details on what failed validation.