Hi everyone. What is the best for performing globa...
# mlforecast
d
Hi everyone. What is the best for performing global transformation on exogenous features? For example, I want to try a MinMax scaler to every exogenous variable. Is there a way to make this easy, so that it is applied internally everytime we pass the future dataframe? Thank you very much!
j
Hey. You can probably do this with scikit learn estimators
👍 1
d
Got it, thank you! I was wondering if there was something similar to the neuralforecast
local_scaler_type
, but I guess there is not.
j
i have seen people scaling using tree based models. to my knowledge there is no need for that, so unless you want to use a classical regression like ridge or so, i think you don't really need it
d
Thanks. Yes, I wanted to have a well-performing classical regression model as a "basecase" to compare against.
I guess the following is what I needed; it seems to be working correctly.
Copy code
scaler_X = MinMaxScaler(feature_range=(-1,1))
model    = make_pipeline(scaler_X, MLPRegressor())

# Instantiate the MLForecast object
mlf = MLForecast(
    models={'mlmodel': model},
    freq='h',  
    lags=list(range(1, 3)), 
)
j
can you combine MLP with mlforecast? i would have thought it is part of neuralforecast
d
I was following this tutorial as a starting point: https://nixtlaverse.nixtla.io/mlforecast/docs/how-to-guides/prediction_intervals.html It uses MLP with mlforecast
👍 1
j
cool, i was not aware 🙂 thx
🙂 1
t
@jan rathfelder you can use anything that follows a scikitlearn fit-predict pattern including creating your own class. And generally scaling isnt a thing for trees but for global time series forecasting you definitely want to at least have scaling as part of your hyperparameter tuning and view differencing as a type of scalar as well.
👍 1
j
thx