File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
timecopilot/models/adapters Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 118118 "id" : " 4bb01c41" ,
119119 "metadata" : {},
120120 "source" : [
121- " ## Create a TimeCopilot instance with your sktime model\n " ,
121+ " ## Create a TimeCopilot instance with your skforecast model\n " ,
122122 " \n " ,
123- " You will need to specify the forecasters you're using when using sktime models. "
123+ " You will need to specify the forecasters you're using when using skforecast models. "
124124 ]
125125 },
126126 {
Original file line number Diff line number Diff line change @@ -133,14 +133,22 @@ def forecast(
133133
134134 Example:
135135 ```python
136+ from lightgbm import LGBMRegressor
136137 import pandas as pd
137138 from timecopilot import TimeCopilot
138- from timecopilot.models.adapters.sktime import SKTimeAdapter
139- from sktime.forecasting.trend import TrendForecaster
139+ from timecopilot.models.adapters.skforecast import SKForecastAdapter
140+ from skforecast.recursive import ForecasterRecursive
141+ from skforecast.preprocessing import RollingFeatures
142+
143+ forecaster = ForecasterRecursive(
144+ estimator = LGBMRegressor(random_state=123, verbose=-1),
145+ lags = 10,
146+ window_features = RollingFeatures(stats=['mean'], window_sizes=10)
147+ )
140148
141149 df = pd.read_csv("https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv")
142- adapted_skt_model = SKTimeAdapter(TrendForecaster() )
143- tc = TimeCopilot(llm="openai:gpt-4o", forecasters=[adapted_skt_model ])
150+ adapted_skf_model = SKForecastAdapter(forecaster )
151+ tc = TimeCopilot(llm="openai:gpt-4o", forecasters=[adapted_skf_model ])
144152 result = tc.forecast(df, h=12, freq="MS")
145153 print(result.output)
146154 ```
You can’t perform that action at this time.
0 commit comments