Cristian Contrera
Cristian Contrera

Reputation: 713

How to set weights_column in H2OAutoML?

I was trying use H2OAutoML in Python to create a regression model, but I can't find how to pass 'weights_column'.

I try this two ways:

# Create the AutoML model.
aml = H2OAutoML(
        seed=0,
        max_runtime_secs = None,
        include_algos=['GBM', 'DRF'],
        stopping_metric='RMSE',
        exploitation_ratio=0.1,
        weights_column='weight'
    )

This code raise an TypeError:
TypeError: H2OAutoML got an unexpected keyword argument 'weights_column'

# Create the AutoML model.
aml = H2OAutoML(
        seed=0,
        max_runtime_secs = None,
        include_algos=['GBM', 'DRF'],
        stopping_metric='RMSE',
        exploitation_ratio=0.1,
        algo_parameters={'weights_column': 'weight'}
    )

And this code raise H2oResponseError on train step:

H2OResponseError: Server error water.exceptions.H2OIllegalValueException:
Error: Illegal value for field: algo_parameters: weights_column

Can Someone help me to use this parameter? thanks

Upvotes: 1

Views: 361

Answers (1)

Neema Mashayekhi
Neema Mashayekhi

Reputation: 930

You call the weights_column from the .train() method. For example:

aml.train(x=x, y=y, training_frame=train, weights_column='weight')

Upvotes: 2

Related Questions