不支持 'Unknown' 类型的输入。支持的类型:[azureml.data.tabular_dataset.TabularDataset、azureml.pipeline.core

Input of type 'Unknown' is not supported. Supported types: [azureml.data.tabular_dataset.TabularDataset, azureml.pipeline.core

根据该文档: https://docs.microsoft.com/en-us/python/api/azureml-train-automl-client/azureml.train.automl.automlconfig.automlconfig?view=azure-ml-py

training_data 可以是数据框或数据集。

但是,当我使用数据框时出现此错误:


ConfigException: ConfigException:
    Message: Input of type 'Unknown' is not supported. Supported types: [azureml.data.tabular_dataset.TabularDataset, azureml.pipeline.core.pipeline_output_dataset.PipelineOutputTabularDataset]
    InnerException: None
    ErrorResponse 
{
    "error": {
        "code": "UserError",
        "message": "Input of type 'Unknown' is not supported. Supported types: [azureml.data.tabular_dataset.TabularDataset, azureml.pipeline.core.pipeline_output_dataset.PipelineOutputTabularDataset]",
        "details_uri": "https://aka.ms/AutoMLConfig",
        "target": "training_data",
        "inner_error": {
            "code": "BadArgument",
            "inner_error": {
                "code": "ArgumentInvalid",
                "inner_error": {
                    "code": "InvalidInputDatatype"
                }
            }
        }
    }
}

我的代码真的很简单:


client = CosmosClient(HOST, MASTER_KEY)
database = client.get_database_client(database=DATABASE_ID)
container = database.get_container_client(CONTAINER_ID)

item_list = list(container.read_all_items(max_item_count=10))
df = pd.DataFrame(item_list)

from azureml.core.workspace import Workspace
ws = Workspace.from_config()

from azureml.automl.core.forecasting_parameters import ForecastingParameters

forecasting_parameters = ForecastingParameters(time_column_name='EventEnqueuedUtcTime', 
                                               forecast_horizon=50,
                                               time_series_id_column_names=["eui"],
                                               freq='H',
                                               target_lags='auto',
                                               target_rolling_window_size=10)

from azureml.core.workspace import Workspace
from azureml.core.experiment import Experiment
from azureml.train.automl import AutoMLConfig
from azureml.core.compute import ComputeTarget, AmlCompute
import logging

amlcompute_cluster_name = "computecluster"
compute_target = ComputeTarget(workspace=ws, name=amlcompute_cluster_name)
experiment_name = 'iot-forecast'

experiment = Experiment(ws, experiment_name)

automl_config = AutoMLConfig(task='forecasting',
                             primary_metric='normalized_root_mean_squared_error',
                             experiment_timeout_minutes=100,
                             enable_early_stopping=True,
                             training_data=df,
                             compute_target = compute_target,
                             label_column_name='TempC_DS',
                             n_cross_validations=5,
                             enable_ensembling=False,
                             verbosity=logging.INFO,
                             forecasting_parameters=forecasting_parameters)

remote_run = experiment.submit(automl_config, show_output=True)

我在这里错过了什么?

看来您正在尝试远程 运行 实验,AFAIK 并根据文档 here :

您可以参考这篇文章来了解创建Azure ML TabularDataset