This message was deleted.
# mlforecast
s
This message was deleted.
m
perhaps, I can figure it out with a class
Copy code
GlobalSklearnTransformer(BaseTargetTransform):
j
That class will only apply the transformation to the target as well. We have this issue to implement transformations on the features. We'll work on it soon. At the moment you'd have to do it manually, i.e. apply PCA to your features before calling MLForecast.fit/cv
👍 1
m
yes that is fine, it is however tricky with proper cross validation as doing it over the complete dataset might leak info in some cases.
j
I think you can use a pipeline for this, e.g.
Copy code
from sklearn.compose import ColumnTransformer
from sklearn.decomposition import PCA
from sklearn.pipeline import make_pipeline

pca = ColumnTransformer([('pca', PCA(), ['exog1', 'exog2'])], remainder='passthrough')
model = make_pipeline(pca, your_model)
fcst = MLForecast(model=model, ...)
nixtlablack 1
👍 2