{"id":7036,"library":"azureml-train-automl","title":"Azure ML AutoML Training (SDK v1)","description":"The `azureml-train-automl` package is part of the Azure Machine Learning SDK v1, designed for automatically finding the best machine learning model and its parameters. It streamlines model selection, hyperparameter tuning, and feature engineering for various ML tasks like classification, regression, and forecasting. As of v1.62.0, Azure Machine Learning SDK v1 is deprecated with support ending on June 30, 2026. Users are strongly advised to migrate to Azure Machine Learning SDK v2 for continued support and new features.","status":"maintenance","version":"1.62.0","language":"en","source_language":"en","source_url":"https://learn.microsoft.com/en-us/azure/machine-learning/","tags":["azure","machine-learning","automl","sdk-v1","model-training","deprecated"],"install":[{"cmd":"pip install azureml-train-automl","lang":"bash","label":"Install `azureml-train-automl`"}],"dependencies":[{"reason":"Required for workspace connection, experiment management, and core Azure ML functionalities.","package":"azureml-core","optional":false}],"imports":[{"note":"The `azureml.automl.core` package is intended for internal SDK use and not direct consumption.","wrong":"from azureml.automl.core import AutoMLConfig","symbol":"AutoMLConfig","correct":"from azureml.train.automl import AutoMLConfig"},{"symbol":"Experiment","correct":"from azureml.core.experiment import Experiment"},{"symbol":"Workspace","correct":"from azureml.core import Workspace"},{"symbol":"Dataset","correct":"from azureml.core.dataset import Dataset"}],"quickstart":{"code":"import os\nimport pandas as pd\nfrom azureml.core.workspace import Workspace\nfrom azureml.core.experiment import Experiment\nfrom azureml.core.dataset import Dataset\nfrom azureml.train.automl import AutoMLConfig\n\n# NOTE: Replace with your actual workspace details or ensure config.json is present\ntry:\n    ws = Workspace.from_config()\n    print(f\"Workspace loaded: {ws.name}\")\nexcept Exception as e:\n    print(f\"Could not load workspace from config. Attempting environment variables. Error: {e}\")\n    subscription_id = os.environ.get(\"AZUREML_SUBSCRIPTION_ID\", \"YOUR_SUBSCRIPTION_ID\")\n    resource_group = os.environ.get(\"AZUREML_RESOURCE_GROUP\", \"YOUR_RESOURCE_GROUP\")\n    workspace_name = os.environ.get(\"AZUREML_WORKSPACE_NAME\", \"YOUR_WORKSPACE_NAME\")\n    if \"YOUR_\" in subscription_id + resource_group + workspace_name:\n        raise ValueError(\"Please configure your Azure ML Workspace details via config.json or environment variables.\")\n    ws = Workspace.get(name=workspace_name, subscription_id=subscription_id, resource_group=resource_group)\n    print(f\"Workspace loaded from env: {ws.name}\")\n\nexperiment_name = \"automl-quickstart-exp\"\nexperiment = Experiment(ws, experiment_name)\n\n# Load sample data (replace with your own Dataset registration or data path)\ndata_url = \"https://automlsamplenotebookdata.blob.core.windows.net/automl-sample-notebook-data/creditcard.csv\"\ndf = pd.read_csv(data_url)\n\n# For simplicity, create a dummy Dataset. In a real scenario, you'd register your data.\n# Or use a registered dataset: Dataset.get_by_name(ws, name='my_dataset')\nfrom azureml.data.tabulardataset import TabularDataset\ntraining_data = TabularDataset.from_pandas_dataframe(df, target=(ws.get_default_datastore(), 'automl_creditcard.csv'))\n\n# Configure AutoML\nautoml_config = AutoMLConfig(\n    task='classification',\n    primary_metric='accuracy',\n    training_data=training_data,\n    label_column_name='Class',\n    compute_target='local',\n    experiment_timeout_minutes=15,\n    max_concurrent_iterations=1,\n    n_cross_validations=2,\n    iterations=5,\n    verbosity=logging.INFO\n)\n\n# Submit the AutoML run\n# NOTE: 'local' compute target runs on the current environment, may require many local dependencies.\n# For remote compute, configure an AmlCompute target and specify it in AutoMLConfig.\nprint(\"Submitting AutoML experiment...\")\n# run = experiment.submit(automl_config, show_output=True)\n# print(f\"AutoML experiment submitted: {run.id}\")\n# print(\"NOTE: Uncomment the submit line and ensure compute target is configured for actual execution.\")\n\nimport logging # Ensure logging is imported for verbosity","lang":"python","description":"This quickstart demonstrates how to set up and submit an AutoML experiment using `AutoMLConfig`. It includes connecting to an Azure Machine Learning Workspace, loading sample data, and configuring basic AutoML settings for a classification task. Ensure your Azure ML Workspace is configured (via `config.json` or environment variables) and a compute target is available. For actual execution, remote AmlCompute is recommended over 'local' to avoid extensive local dependency conflicts."},"warnings":[{"fix":"Migrate your ML workflows to Azure Machine Learning SDK v2. Refer to the official Azure ML documentation for migration guides.","message":"Azure Machine Learning SDK v1, which `azureml-train-automl` is part of, is deprecated as of March 31, 2025. Support will end on June 30, 2026. Existing workflows will continue to operate but could be exposed to security risks or breaking changes.","severity":"breaking","affected_versions":"All v1 versions after 2025-03-31"},{"fix":"Before upgrading, completely uninstall the old version using `pip uninstall azureml-train-automl`. Alternatively, after upgrading, run `pip install --upgrade azureml-train-automl` followed by `pip install --ignore-installed azureml-train-automl-client`.","message":"Upgrading `azureml-train-automl` from versions prior to `1.0.76` can lead to partial installations and import failures due to internal dependency conflicts.","severity":"gotcha","affected_versions":"<1.0.76 to >=1.0.76"},{"fix":"If these specific algorithms are required, use `azureml-train-automl` v1.48.0 or below, or switch to alternative algorithms. Consider migrating to SDK v2 for modern algorithm support.","message":"Several AutoML algorithms for Regression (`FastLinearRegressor`, `OnlineGradientDescentRegressor`) and Classification (`AveragedPerceptronClassifier`) were deprecated and are no longer supported in versions `1.49.0` and above.","severity":"breaking","affected_versions":">=1.49.0"},{"fix":"For SDK versions `>1.13.0`, ensure `pandas==0.25.1` and `scikit-learn==0.22.1`. Use `pip install --upgrade pandas==0.25.1` and `pip install --upgrade scikit-learn==0.22.1`. Always verify the required environment from your experiment's `conda.yml` for exact versions.","message":"Dependency mismatches, especially with `pandas` and `scikit-learn`, are a common source of errors (e.g., `Module not found`, `ImportError`, `AttributeError`) due to strict version pinning in older SDK v1 releases.","severity":"gotcha","affected_versions":"All v1 versions, especially after 1.13.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Uninstall the package completely and reinstall it: `pip uninstall azureml-train-automl` followed by `pip install azureml-train-automl`. If still using older SDK versions, ensure consistent environment.","cause":"Often occurs after upgrading `azureml-train-automl` from very old versions, leading to partial or corrupted installations.","error":"ImportError: cannot import name 'AutoMLConfig'"},{"fix":"Upgrade or downgrade `scikit-learn` to a compatible version, typically `scikit-learn==0.22.1` for SDK v1.13.0 and above: `pip install --upgrade scikit-learn==0.22.1`. Consult the environment details for your specific Azure ML run.","cause":"Incompatibility between the `azureml-train-automl` SDK version and locally installed `scikit-learn` or other dependent libraries.","error":"ModuleNotFoundError: No module named 'sklearn.decomposition._truncated_svd' (or similar 'No module named' errors)"},{"fix":"Verify and align your `pandas` and `scikit-learn` versions with the requirements for your `azureml-train-automl` SDK version. For SDK v1.13.0+, use `pandas==0.25.1` and `scikit-learn==0.22.1`.","cause":"Similar to `ModuleNotFoundError`, this indicates an incompatibility, often with `scikit-learn` or `pandas` versions, where a method or attribute expected by AutoML's internal code is missing.","error":"AttributeError: 'SimpleImputer' object has no attribute 'add_indicator' (or similar 'AttributeError')"},{"fix":"Ensure your local environment has all necessary dependencies correctly installed and version-matched. For complex local setups, consider using an Azure ML Compute Instance, which provides pre-configured environments compliant with AutoML requirements, or defining a custom Conda environment for the run.","cause":"Local Python environment dependencies not matching the requirements for AutoML local training.","error":"ValidationException during local AutoML training"}]}