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)
- [MLForecast] lag_transforms with different features packages HOT 6
- MLForecast: Core: Add prediction intervals to forecast_fitted_values
- [Core] Saving of the model HOT 20
- [core]Using multiple models can cause `new_x` lag feature shift HOT 2
- [Core]`ts.update` method may not support target_transforms,lag_transforms and date_features HOT 1
- [Model] Distributed version of the model giving Arrow Capacity error HOT 6
- predict() and cross_validation() outputs inconsistency HOT 6
- Dynamic features for training HOT 1
- model.predict encounters an error HOT 3
- Does mlforecast train a single global model or one model per serie? HOT 2
- mlforecast: can the number of exogenous variables be different for different unique_id? HOT 2
- MLforecast does not work with with PyArrow dates HOT 2
- Fcst.predict does not accept X_df with dynamic exogenous variables HOT 2
- [Model] Distributed and Non-distributed version of the models giving different result HOT 8
- [MLForecast: test set eval and early stopping ] HOT 2
- AutoDifferences, AutoSeasonalityAndDifferences result in "AttributeError: 'NoneType' object has no attribute 'AutoDifferences'" HOT 2
- 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
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.