Naren Castellon
05/15/2024, 3:38 PMmodels = [make_pipeline(
StandardScaler(),
RandomForestRegressor(random_state=123, n_estimators=1000, max_depth= 5))]
mlf = MLForecast(models=models,
freq='D',
num_threads=6)
If I view the data with
mlf.preprocess(data)
You don't see any change in the pipeline transformation or do you?
My question is this:
Can the transformation be seen using mlf.preprocess(data)
or not?
or the transformation is done when I use the fit()
methodJosé Morales
05/15/2024, 3:58 PMNaren Castellon
05/15/2024, 4:02 PMmodels = [make_pipeline(
StandardScaler(),
RandomForestRegressor(random_state=123, n_estimators=1000, max_depth= 5))]
The transformation would be the StandardScaler(),
which I suppose should be applied to the target variable and that is not how it works.
Or should I apply a lag
, and Pipeline will be applied to that new transformation, which is the lag?José Morales
05/15/2024, 4:05 PMfrom mlforecast.target_transforms import LocalStandardScaler
mlf = MLForecast(
models=models,
freq='D',
target_transforms=[LocalStandardScaler()],
num_threads=6,
)
Naren Castellon
05/15/2024, 4:10 PMJosé Morales
05/15/2024, 4:14 PMX, y = mlf.preprocess(data, return_X_y=True) # this builds the features and applies target transformations
models[0][:-1].fit_transform(X) # this applies the steps before the model in the pipeline
Naren Castellon
05/15/2024, 4:15 PM