Skip to content

[BUG] gridsearch with RegressionModel #2104

Open
@ETTAN93

Description

@ETTAN93

I am trying to implement grid search for 3 parameters in the elasticnet regression model from sklearn and wrapping the darts RegressionModel around that. Based on the documentation of grid search, this is how I initialised the grid search:

grid_params = {
    'max_iter': [1, 5, 10, 50, 100, 200],
    'alpha': [1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 0.0, 1.0, 10.0, 100.0],
    'l1_ratio': [0.01, 0.1, 0.3, 0.6, 0.9, 1]
}

sklearn_elasticnet_model = make_pipeline(
    ElasticNet(random_state = 42)
)

elasticnet_model = RegressionModel(
    lags=target_lags,
    lags_past_covariates=past_cov_lags, 
    lags_future_covariates=future_cov_lags,
    output_chunk_length=forecast_horizon,
    multi_models=True,
    model=sklearn_elasticnet_model
)

elasticnet_model.gridsearch(grid_params,
                            series=target_series_sample,
                            future_covariates=future_cov_sample,
                            forecast_horizon=24,
                            stride=24)

However, I am getting this error: TypeError: RegressionModel.__init__() got an unexpected keyword argument 'max_iter'. Am I implementing it wrongly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions