{"id":7035,"library":"azureml-automl-core","title":"Azure ML AutoML Core Library","description":"This package contains the non-ML, non-Azure specific common code associated with running AutoML experiments within Azure Machine Learning. It serves as a foundational dependency for higher-level AutoML packages like `azureml-train-automl`, rather than being directly used by most end-users. It is part of the broader Azure ML SDK ecosystem, which typically has a monthly or bi-monthly release cadence, keeping sub-packages in sync.","status":"active","version":"1.62.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azureml-sdk","tags":["azure","azureml","automl","machine-learning","cloud","sdk","internal-dependency"],"install":[{"cmd":"pip install azureml-automl-core","lang":"bash","label":"Install core AutoML dependency only"},{"cmd":"pip install azureml-sdk[automl]","lang":"bash","label":"Recommended: Install full AutoML SDK with AutoML capabilities"}],"dependencies":[{"reason":"Internal dependency for telemetry collection.","package":"azureml-telemetry","optional":false},{"reason":"Used for data serialization/deserialization, often with strict version constraints.","package":"dataclasses-json","optional":false},{"reason":"Core numerical computing library, often a source of version conflicts.","package":"numpy","optional":false},{"reason":"Data manipulation and analysis, also sensitive to versioning.","package":"pandas","optional":false},{"reason":"Machine learning algorithms (base for many AutoML operations).","package":"scikit-learn","optional":false},{"reason":"Scientific computing library.","package":"scipy","optional":false}],"imports":[],"quickstart":{"code":"import os\nfrom azureml.core import Workspace, Experiment\nfrom azureml.core.compute import AmlCompute, ComputeTarget\nfrom azureml.core.dataset import Dataset\nfrom azureml.data.datapath import DataPath\nfrom azureml.train.automl import AutoMLConfig\n\n# NOTE: azureml-automl-core is an internal dependency. \n# End-users typically interact with AutoML via azureml.train.automl.\n# This quickstart demonstrates the standard way to run an AutoML experiment.\n\n# Authenticate and get workspace\n# Assumes 'config.json' in current directory or Azure CLI login (az login)\nws = Workspace.from_config()\nprint(f\"Workspace name: {ws.name}\")\n\n# Create a compute target (or use an existing one)\ncompute_name = os.environ.get('AML_COMPUTE_CLUSTER_NAME', 'cpu-cluster') # Example name\ntry:\n    compute_target = ComputeTarget(workspace=ws, name=compute_name)\n    print(f'Found existing compute target: {compute_name}')\nexcept Exception:\n    print(f'Creating a new compute target: {compute_name}...')\n    config = AmlCompute.provisioning_configuration(\n        vm_size='STANDARD_DS3_V2', \n        max_nodes=4,\n        idle_seconds_before_scaledown=1800 # Scale down after 30 mins idle\n    )\n    compute_target = ComputeTarget.create(ws, compute_name, config)\n    compute_target.wait_for_completion(show_output=True)\n\n# Register a dataset (using sample data for demonstration)\n# Replace with your actual data source or an already registered dataset\n# Example: data = Dataset.Tabular.from_delimited_files(path='https://...\n# Placeholder using dummy data for syntax:\nfrom azureml.data.data_reference import DataReference\nfrom azureml.data.datastore import Datastore\n# If you have a datastore and path to a file:\n# default_datastore = ws.get_default_datastore()\n# training_data = Dataset.Tabular.from_delimited_files(path=[(default_datastore, 'path/to/your/data.csv')])\n\n# For runnable example without actual data/datastore setup:\n# Create a dummy dataset reference (won't actually run, but shows API)\nprint(\"Note: This quickstart uses a dummy dataset reference for demonstration purposes.\")\nprint(\"Replace with your actual data registration for a functional run.\")\ntraining_data = Dataset.Tabular.from_delimited_files(path=['https://archive.ics.uci.edu/ml/machine-learning-databases/00267/data_banknote_authentication.txt'])\ntraining_data = training_data.register(workspace=ws, name='dummy_banknote_data', description='Dummy Banknote Data', create_new_version=True)\n\n# Configure AutoML run\nautoml_config = AutoMLConfig(\n    task='classification',\n    primary_metric='accuracy',\n    experiment_timeout_minutes=15, # Max time in minutes for the experiment\n    training_data=training_data,\n    label_column_name='4', # Assuming '4' is the label column in dummy data\n    compute_target=compute_target,\n    n_cross_validations=2,\n    max_concurrent_iterations=2,\n    max_cores_per_iteration=-1, # Use all available cores\n    enable_early_stopping=True,\n    featurization='auto',\n    debug_log='automl_errors.log'\n)\n\n# Create and submit experiment (commented out to prevent accidental billing)\n# experiment_name = 'automl-quickstart-exp'\n# experiment = Experiment(ws, experiment_name)\n# local_run = experiment.submit(automl_config, show_output=True)\n# local_run.wait_for_completion(wait_for_completion=True, show_output=True)\n# print('AutoML run submitted.')","lang":"python","description":"The `azureml-automl-core` package is primarily an internal dependency of the Azure ML SDK. End-users typically interact with Azure ML's Automated ML capabilities through the `azureml.train.automl` module, which transparently utilizes this core package. This quickstart demonstrates a typical setup for an AutoML classification experiment using the high-level `azureml.train.automl` API, showing how to connect to a workspace, provision compute, register data, and configure an AutoML run. The `submit` call is commented out to avoid accidental resource usage."},"warnings":[{"fix":"Use `from azureml.train.automl import AutoMLConfig` and other public APIs from `azureml.core` and `azureml.train.automl` instead of attempting direct imports from `azureml_automl_core`.","message":"Direct imports from `azureml_automl_core` are uncommon and generally not recommended for end-users. It contains internal components that are subject to change without notice. The public API for AutoML is exposed through `azureml.train.automl`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment uses Python 3.8, 3.9, 3.10, or 3.11. Consider using `conda` or `venv` environments for isolated and compliant dependency management.","message":"Strict Python version requirements. This package (and the broader Azure ML SDK) requires Python versions `>=3.8, <3.12`. Using unsupported Python versions will lead to `PackageNotFound` during installation or `ModuleNotFoundError` / runtime errors.","severity":"breaking","affected_versions":"All 1.x.x versions"},{"fix":"Always install the full SDK using `pip install azureml-sdk[automl]` (or `[full]`) to ensure compatible versions of all sub-packages are installed. If conflicts persist, create a fresh virtual environment, install `azureml-sdk[automl]` first, and then add other dependencies carefully. `conda` environments often provide more robust dependency resolution for complex stacks.","message":"Dependency conflicts are extremely common within the `azureml-sdk` ecosystem due to strict version pinning across sub-packages. Installing `azureml-automl-core` alongside other data science libraries (e.g., specific versions of `scikit-learn`, `pandas`, `numpy`) can lead to 'PackageNotFound' or 'VersionConflict' errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update your SDK (`pip install --upgrade azureml-sdk[automl]`) and review release notes. Consult the official Azure ML Python SDK documentation for the most current APIs and migration guides.","message":"Azure ML SDK components, including AutoML features, undergo regular updates. Some functionalities, classes, or parameters in older versions might be deprecated or removed in newer releases, leading to `DeprecationWarning` or `AttributeError`.","severity":"deprecated","affected_versions":"Across major and minor version updates (e.g., 1.x to 1.y)"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify your Python version is within the supported range (`>=3.8, <3.12`). If installing directly, consider installing the umbrella `azureml-sdk[automl]` package instead: `pip install azureml-sdk[automl]` to let `pip` resolve compatible dependencies.","cause":"The specified version of `azureml-automl-core` either does not exist for your Python version, or there's an underlying dependency conflict preventing `pip` from finding a compatible version set.","error":"ERROR: Could not find a version that satisfies the requirement azureml-automl-core==X.Y.Z (from versions: ...)"},{"fix":"This specific `TypeError` is often resolved by either downgrading `numpy` (e.g., `pip install numpy==1.23.5`) or ensuring all `azureml` packages are at their latest compatible versions via `pip install --upgrade azureml-sdk[automl]` in a clean virtual environment.","cause":"This error frequently arises from an incompatibility between the installed `numpy` version and other libraries (especially `scikit-learn` or `azureml` components) that expect an older `numpy.random.RandomState` interface.","error":"TypeError: 'numpy.random._generator.Generator' object is not callable"},{"fix":"Avoid importing directly from `azureml_automl_core`. Instead, utilize the public API exposed through `azureml.core` and `azureml.train.automl`. For example, use `from azureml.train.automl import AutoMLConfig`.","cause":"`azureml-automl-core` is predominantly an internal dependency, and its sub-modules are not part of the public API. Direct imports from it are not expected for end-users.","error":"from azureml_automl_core.some_module import SomeClass\nModuleNotFoundError: No module named 'azureml_automl_core.some_module'"},{"fix":"Always use a virtual environment (`venv` or `conda`) to isolate installations and prevent conflicts with system packages. If in a virtual environment and this occurs, try `pip install --ignore-installed <package-name-causing-conflict>` or in extreme cases `pip install --force-reinstall --no-deps azureml-sdk[automl]` (use with caution). Best practice is a fresh `venv`.","cause":"A common dependency conflict when installing or upgrading `azureml-sdk` components, especially on environments with system-installed packages (e.g., `PyYAML` in base Python environments on some Linux distros or with Anaconda).","error":"ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to a partial uninstall. (or similar errors with other system packages)"}]}