Open AVPokrovsky opened 3 days ago
Hi @AVPokrovsky, Could you add a reproducible example with dummy data? What version of skforecast are you using?
This code should run:
from skforecast.model_selection_multiseries import grid_search_forecaster_multiseries
from skforecast.ForecasterAutoregMultiSeries import ForecasterAutoregMultiSeries
from sklearn.ensemble import RandomForestRegressor
import pandas as pd
import numpy as np
# Data
# ==============================================================================
np.random.seed(1)
data = pd.DataFrame(
np.random.normal(loc = 0, scale = 1, size = (1096, 10)),
index = pd.date_range(start='2012-01-01', periods=1096, freq='D'),
columns = ['item' + str(i) for i in range(1, 11)]
)
end_train = '2014-07-15 23:59:00'
# Create Forecaster Multi-Series
# ==============================================================================
forecaster = ForecasterAutoregMultiSeries(
regressor = RandomForestRegressor(random_state=123),
lags = 24,
)
# Grid search Multi-Series
# ==============================================================================
lags_grid = [24, 48]
param_grid = {
'n_estimators': [10, 20],
'max_depth': [3, 7]
}
results_grid = grid_search_forecaster_multiseries(
forecaster = forecaster,
series = data,
param_grid = param_grid,
steps = 7,
metric = 'mean_absolute_error',
initial_train_size = len(data.loc[:end_train,]),
fixed_train_size = False,
exog = None,
lags_grid = lags_grid,
refit = False,
return_best = True,
verbose = False
)
Hi, SVR() was used. May be it depends on forecaster. Sometimes it works with 7 columns, sometimes with 6. I use the last skforecast version. I am bit busy now, I will try to send you example later on.
Some more info, may be it helps to simulate the error
param_grid = {'kernel':[ 'rbf', 'sigmoid']} lags_grid = [1, 2, 5, 10, 20, 40, [1, 3, 5, 7]]
Name: skforecast Version: 0.12.1
Hi, when number of data_m columns exceed 7 the error appears. It worked on previous versions.
ValueError: cannot set WRITEABLE flag to True of this array