Comments (4)
Hey @nelsoncardenas, thanks for using mlforecast and for the detailed report. I think the easiest way to achieve this is with a scikit-learn pipeline. Here's an example:
import pandas as pd
from mlforecast import MLForecast
from mlforecast.utils import generate_daily_series
from sklearn.compose import ColumnTransformer
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import OneHotEncoder
series = generate_daily_series(1, min_length=7, max_length=7)
model = make_pipeline(
ColumnTransformer(
[('encoder', OneHotEncoder(drop='first'), ['dayofweek'])],
remainder='passthrough'
),
LinearRegression()
)
fcst = MLForecast(models={'lr': model}, freq="D", date_features=["dayofweek"])
fcst.fit(series)
print(fcst.models_['lr'].named_steps['linearregression'].n_features_in_) # 6
The available attributes are:
If you have time and would like to do it we'd appreciate a PR that explicitly lists the supported ones.
from mlforecast.
Thank you @jmoralez I'd like to help with that PR.
What would be the suggested steps?
from mlforecast.
I think you could add two lists (one for pandas and one for polars) in the nbs/core.ipynb notebook. We have this file with some contributing guidelines, but the first step should be to fork this repository and work on your fork instead (I'll fix that soon). Let me know if you have any questions.
from mlforecast.
@jmoralez Thank you. During the week I will dedicate some free time to it.
from mlforecast.
Related Issues (20)
- Lag feature: how initial values are treated or populated once the data has been shifted? HOT 2
- [Core] getting an error module 'coreforecast.lag_transforms' has no attribute 'BaseLagTransform' HOT 3
- [distributed]: allow for .ts.update in DistributedMLForecast HOT 3
- Mlforecast + AutoDifferences + fitted=True HOT 2
- get performance on training set HOT 2
- Unbale to do LogTransformation using target_transformation HOT 2
- [MLForecast] Add the possibility to pass custom parameters to the fit function HOT 6
- Forecasting produces nearly horizontal results HOT 4
- Cross validation with prediction_intervals and in-sample predictions enabled lacks folds
- MLForecast - Support historic covariates out of the box HOT 3
- MLForecast LinearRegression Isn't Applied to Each Unique Id Time Series Seperately HOT 1
- Not enough models trained in cross_validation with fitted=True and horizon > 9
- [Custom Training] Add custom training for Cross Validation
- Found missing inputs in X_df. It should have one row per id and time for the complete forecasting horizon. HOT 13
- [core] speed up date features calculation
- Electricity load tutorial problem HOT 3
- SHAP with exogenous features HOT 4
- All series are too short for the cross validation settings
- ValueError on make_future_dataframe HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlforecast.