MachineLearningNotebooks icon indicating copy to clipboard operation
MachineLearningNotebooks copied to clipboard

AutoML An empty value for argument [array] is provided.",

Open levalencia opened this issue 5 years ago • 7 comments

Hello I have the following code:


df = load_data()
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
df.head(5)
df.dtypes
df = df.drop(['sdBillCancelledDate','vcReason','chOriginalBillNo'], axis=1)

df = df.select_dtypes(exclude=['datetime64[ns]'])
df.head(5)
df.dropna(inplace=True)
#clean_dataset(df)
df.head(500)

# Separate features and labels
X, y = df[['totalDaysToPay', 'paidOnTime','dcTotFeeBilledAmt','dcFinalBillExpAmt','dcTotProgBillAmt', 'dcTotProgBillExpAmt','dcTotProgBillExpAmt','dcReceiveBillAmt','dcTotWipHours','dcTotWipTargetAmt','dcTotNetBillAmt','chBillStatus','chBillType','chDebtorCode','OperatingUnit','BusinessUnit','LosCode']].values, df['paidInDays'].values
print('Features:',X[:10], '\nLabels:', y[:10], sep='\n')


from sklearn.model_selection import train_test_split

# Split data 70%-30% into training set and test set
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, random_state=0)

print ('Training Set: %d rows\nTest Set: %d rows' % (X_train.shape[0], X_test.shape[0]))


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

import logging

automl_settings = {
    "iteration_timeout_minutes": 1000,
    "experiment_timeout_hours": 1,
    "enable_early_stopping": True,
    "primary_metric": 'spearman_correlation',
    "featurization": 'auto',
    "verbosity": logging.INFO,
    "n_cross_validations": 5
}

from azureml.train.automl import AutoMLConfig

automl_config = AutoMLConfig(task='regression',
                             debug_log='automated_ml_errors.log',
                             training_data=X_train,
                             label_column_name="paidInDays",
                             **automl_settings)

from azureml.core.experiment import Experiment
experiment = Experiment(ws, "ipower")
local_run = experiment.submit(automl_config, show_output=True)

However I get this error:


ValidationException: ValidationException:
	Message: An empty value for argument [array] is provided.
	InnerException: None
	ErrorResponse 
{
    "error": {
        "code": "UserError",
        "message": "An empty value for argument [array] is provided.",
        "target": "array",
        "inner_error": {
            "code": "BadArgument",
            "inner_error": {
                "code": "ArgumentBlankOrEmpty"
            }
        }
    }
}

levalencia avatar Jan 20 '21 08:01 levalencia

is this a bug in the SDK or something wrong on my data/code? can you please confirm.

levalencia avatar Jan 25 '21 10:01 levalencia

@levalencia can you please share the SDK version and run id?

jialiu103 avatar Jan 25 '21 20:01 jialiu103

how can I get this info?

levalencia avatar Jan 25 '21 20:01 levalencia

to get the SDK you can run this in your notebook: from azureml.core import Workspace import pandas as pd

set up workspace

ws= Workspace.from_config()

Take a look at Workspace

ws.get_details()

output = {} output['SDK version'] = azureml.core.VERSION

Aniththa avatar Jan 25 '21 21:01 Aniththa

1.19.0

levalencia avatar Jan 26 '21 14:01 levalencia

@levalencia we noticed the way you split the data:

Separate features and labels X, y = df[['totalDaysToPay', 'paidOnTime','dcTotFeeBilledAmt','dcFinalBillExpAmt','dcTotProgBillAmt', 'dcTotProgBillExpAmt','dcTotProgBillExpAmt','dcReceiveBillAmt','dcTotWipHours','dcTotWipTargetAmt','dcTotNetBillAmt','chBillStatus','chBillType','chDebtorCode','OperatingUnit','BusinessUnit','LosCode']].values, df['paidInDays'].values print('Features:',X[:10], '\nLabels:', y[:10], sep='\n')

from sklearn.model_selection import train_test_split

Split data 70%-30% into training set and test set X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, random_state=0)

and the way they pass it to automl: automl_config = AutoMLConfig(task='regression', debug_log='automated_ml_errors.log', training_data=X_train, label_column_name="paidInDays", **automl_settings)

**don’t match. You should pass X=X_train, y=y_train. or split df into train and test and pass the train part as training_data.

Please let me know if you have any questions.**

Aniththa avatar Jan 26 '21 23:01 Aniththa

thanks, with just DF it works

levalencia avatar Jan 27 '21 13:01 levalencia