Skip to content

Commit

Permalink
Add mlforecast
Browse files Browse the repository at this point in the history
  • Loading branch information
baniasbaabe committed Nov 27, 2023
1 parent be6d955 commit e47926d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions book/machinelearning/timeseries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,55 @@
"for train, test in cv.split(range(10)):\n",
" print(\"train:\", train, \"test:\", test)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Time Series Forecasting with Machine Learning with `mlforecast`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Do you want to perform powerful time series forecasting?\n",
"\n",
"Try `mlforecast` by Nixtla.\n",
"\n",
"`mlforecast` lets you run Machine Learning models for time series forecasting, even on remote clusters like Ray or Spark.\n",
"\n",
"Feature Engineering, support for exogenous variables, and probabilistic forecasting are also included."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install mlforecast"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import lightgbm as lgb\n",
"\n",
"from mlforecast import MLForecast\n",
"from sklearn.linear_model import LinearRegression\n",
"\n",
"mlf = MLForecast(\n",
" models = [LinearRegression(), lgb.LGBMRegressor()],\n",
" lags=[1, 12],\n",
" freq = 'M'\n",
")\n",
"mlf.fit(df)\n",
"mlf.predict(12)"
]
}
],
"metadata": {
Expand Down

0 comments on commit e47926d

Please sign in to comment.