{"id":7972,"library":"azureml-train-automl-client","title":"Azure ML AutoML Client","description":"The `azureml-train-automl-client` library is a core component of the Azure Machine Learning Python SDK v1, enabling users to automatically find the best machine learning model and its hyperparameters for various tasks like classification, regression, and forecasting. As of version 1.62.0, it supports Python versions >=3.8 and <3.12. Its release cadence is tightly coupled with the broader Azure ML SDK v1, which typically saw monthly or bi-monthly updates.","status":"active","version":"1.62.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azureml-examples","tags":["azure","machine-learning","automl","cloud","sdk","v1-sdk"],"install":[{"cmd":"pip install azureml-train-automl-client","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"This package is a client for the Azure ML platform and requires core functionalities like Workspace and Experiment management.","package":"azureml-core","optional":false},{"reason":"Used for collecting usage data and diagnostics.","package":"azureml-telemetry","optional":false}],"imports":[{"symbol":"AutoMLConfig","correct":"from azureml.train.automl import AutoMLConfig"},{"symbol":"AutoMLTabularFeaturizationConfig","correct":"from azureml.train.automl.automl_config import AutoMLTabularFeaturizationConfig"},{"note":"Workspace is part of `azureml-core`, not `azureml-train-automl-client`.","wrong":"from azureml.train.automl import Workspace","symbol":"Workspace","correct":"from azureml.core import Workspace"}],"quickstart":{"code":"import os\nfrom azureml.core import Workspace, Experiment, Dataset\nfrom azureml.train.automl import AutoMLConfig\n\n# Placeholder for Azure ML Workspace details\nsubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'your_subscription_id')\nresource_group = os.environ.get('AZURE_RESOURCE_GROUP', 'your_resource_group')\nworkspace_name = os.environ.get('AZURE_WORKSPACE_NAME', 'your_workspace_name')\n\n# Ensure these are replaced with actual valid values or environment variables\nif 'your_' in subscription_id or 'your_' in resource_group or 'your_' in workspace_name:\n    print(\"WARNING: Please set AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP, AZURE_WORKSPACE_NAME environment variables \")\n    print(\"or replace placeholder values in the quickstart code for actual execution.\")\n    # Exit or use dummy data for demonstration if not intended to run live\n    exit(1)\n\ntry:\n    ws = Workspace.get(name=workspace_name,\n                       subscription_id=subscription_id,\n                       resource_group=resource_group)\n    print(f\"Workspace '{ws.name}' loaded successfully.\")\nexcept Exception as e:\n    print(f\"Could not load workspace. Error: {e}\")\n    # Handle workspace creation or authentication error\n    exit(1)\n\n# Create an experiment\nexperiment = Experiment(workspace=ws, name='automl-quickstart-experiment')\n\n# Example: Load a registered dataset (replace with your actual dataset)\n# For a real run, you'd register a dataset or use a local one.\n# This is a dummy to make the code runnable for structure.\n# In a real scenario, you'd load your training data like:\n# training_data = Dataset.get_by_name(ws, name='my_training_dataset')\n\n# Create a dummy AutoMLConfig (requires actual data and compute for a real run)\nautoml_config = AutoMLConfig(\n    task='classification',\n    primary_metric='accuracy',\n    experiment_timeout_minutes=30,\n    training_data=None, # Replace with your actual Dataset object, e.g., training_data\n    label_column_name='target_column', # Replace with your target column name\n    compute_target='cpu-cluster', # Replace with your compute target name\n    enable_early_stopping=True,\n    n_cross_validations=5,\n    max_concurrent_iterations=2,\n    max_cores_per_iteration=-1, # Use all available cores\n    # Additional settings like featurization, blacklisting, etc. can be added\n)\n\nprint(\"AutoMLConfig created. To run, you would submit it:\")\nprint(\"run = experiment.submit(automl_config, show_output=True)\")\nprint(\"run.wait_for_completion(show_output=True)\")\n# To run the experiment:\n# run = experiment.submit(automl_config, show_output=True)\n# run.wait_for_completion(show_output=True)\n","lang":"python","description":"This quickstart demonstrates how to initialize an `AutoMLConfig` for a classification task. It first attempts to load an existing Azure ML Workspace using environment variables. It then creates an `Experiment` object and provides a template for configuring and submitting an AutoML run. Note that for actual execution, you must provide a valid `training_data` `Dataset` object, `label_column_name`, and a `compute_target`."},"warnings":[{"fix":"Choose either v1 (`azureml-*` packages) or v2 (`azure-ai-ml` packages) for your project and stick to it. Do not mix them in the same codebase. For new projects, consider the v2 SDK (`azure-ai-ml`).","message":"The `azureml-train-automl-client` package is part of the Azure ML SDK v1. Microsoft has released a new v2 SDK (`azure-ai-ml`) with different APIs, import paths, and paradigms. Mixing v1 and v2 SDK components can lead to breaking changes or unexpected behavior.","severity":"breaking","affected_versions":"All versions of azureml-train-automl-client when used with v2 SDK components."},{"fix":"Always check the `requires_python` field on PyPI for the specific `azureml-train-automl-client` version you intend to use. For 1.62.0, ensure your environment uses Python >=3.8 and <3.12.","message":"Python version compatibility for `azureml-train-automl-client` and the broader Azure ML SDK v1 can be very strict. Using unsupported Python versions (e.g., Python 3.7 or 3.11/3.12+ for older SDK versions) can lead to installation failures or runtime errors.","severity":"gotcha","affected_versions":"All versions prior to 1.62.0 (which supports <3.12, >=3.8). Specific ranges vary by SDK version."},{"fix":"Ensure your compute target is created, started, and healthy in your Azure ML workspace. Verify its name matches the `compute_target` parameter in `AutoMLConfig` and that it has enough nodes/resources for your job.","message":"AutoML runs require a healthy and accessible compute target (e.g., an Azure Machine Learning Compute Instance or Compute Cluster). If the compute target is not found, not running, or lacks sufficient resources, the experiment submission will fail.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Register your data as a `Dataset` in your Azure ML workspace. When defining `AutoMLConfig`, pass the `Dataset` object directly to `training_data` and `validation_data`. Ensure your compute target has appropriate identity or credential access to the underlying datastore.","message":"Input data for AutoML (training data, validation data) must be accessible from the compute target. This usually means registering it as an `azureml.core.Dataset` in the workspace and ensuring the compute target has network access to the datastore.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install azureml-train-automl-client`. If using multiple environments, activate the correct one before running your script (e.g., `conda activate my_env`).","cause":"The `azureml-train-automl-client` package is not installed in the current Python environment or the environment is not activated.","error":"ModuleNotFoundError: No module named 'azureml.train.automl'"},{"fix":"Verify the workspace details (name, subscription_id, resource_group) are accurate. Ensure your Azure credentials are set up correctly and have 'Contributor' or 'Azure Machine Learning Data Scientist' role on the workspace/resource group.","cause":"The provided workspace name, subscription ID, or resource group is incorrect, or the authenticated user does not have access to it.","error":"UserErrorException: WorkspaceNotFound: The workspace 'your_workspace_name' could not be found."},{"fix":"Check the Azure ML workspace UI to confirm the compute target exists and is in a healthy state. Verify the name used in `AutoMLConfig(compute_target='...')` exactly matches the compute target name in your workspace.","cause":"The compute target specified in `AutoMLConfig` does not exist, is not running, or has been deleted.","error":"UserErrorException: The provided compute target 'my_compute_cluster' could not be found or is in an invalid state."},{"fix":"Consult the official Microsoft Learn documentation for your specific `azureml-train-automl-client` version to confirm valid parameters for `AutoMLConfig`. Update your `azureml-train-automl-client` package to the latest version if you are trying to use newer features.","cause":"You are passing an unsupported parameter to `AutoMLConfig` or a related class, often due to a version mismatch between your installed `azureml-train-automl-client` and the documentation you are following.","error":"TypeError: __init__ received an unexpected keyword argument 'some_parameter'"}]}