
skforecast-ai
io.github.skforecastv0.4.0更新於 Oct 9, 2026
Forecast time series in CSV files: deterministic skforecast workflows and the script that ran.
概覽
讓助理以確定性的 skforecast 工作流程對 CSV 檔案中的時間序列進行預測,並回傳產生結果的指令碼。
- 功能
- 它會分析時間序列,依固定規則選擇預測器與估計器,制定包含滯後、視窗與日曆特徵的方案,然後執行預測或回測,回傳預測值、指標以及實際執行的 skforecast 指令碼(R6、R34、R35、R36)。方法包括 profile、plan、refine_plan、create_cv、forecast、forecast_code、backtest、backtest_code、compare 與 ask(R54、R55、R56、R57、R58、R59、R60、R61)。compare 會用相同資料與交叉驗證回測多個設定並排序,單一序列時還會加入季節性天真基準(R38、R39)。相同輸入一律得到相同的分析、方案、指令碼與預測(R40)。
- 適用情境
- 當你希望助理預測 CSV 時間序列並展示其推理過程時使用:每個決策都來自可讀的規則,每個結果都附上產生它的指令碼(R7)。它適合 Claude Code、Cursor 或 VS Code 等編碼代理以工具形式呼叫此流程(R30、R31、R42)。選用的 LLM 層用於解釋結果或依領域知識調整方案(R46、R47)。
- 執行需求
- 以本機程序方式透過 uvx 執行 PyPI 套件 skforecast-ai-mcp,需要 Python 3.10 或更新版本(R14)。未宣告任何身分驗證、環境變數或標頭。LLM 層是選用的,需要額外安裝以及供應商憑證或本機模型(R13、R27、R50)。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 skforecast-ai,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[skforecast-ai]
About skforecast-ai
The forecasting assistant that shows its work. Give skforecast-ai a time series: it profiles the data, chooses the model with deterministic rules, validates it and returns the forecast together with the skforecast script that produced it. Every decision comes from a rule you can read, the same data always gives the same result, and the script runs on its own with plain skforecast. An optional LLM explains every decision; it never makes them.
36-hour LightGBM forecast of hourly bike sharing users, with its 80% prediction interval against the held-out hours, and the answer of ask() that explains its metrics. Real skforecast-ai outputs, from the animation on ai.skforecast.org.
Installation
The LLM layer is optional. To use it, install the extra ([bedrock] for AWS Bedrock):
Requires Python 3.10 or newer. More options in the installation guide; to install from source, see the Contribution Guide.
Quick example
That single call chose a ForecasterRecursive with a Ridge estimator, its lags and window features, and ran the script that result.code returns. result.profile and result.plan hold every decision and the rule behind it. Drop test_size to train on all the data and forecast the next 12 months.
Same pipeline from the terminal
The CLI covers the whole pipeline, including ask() and the prompts of refine_plan() and create_cv(). See Using the CLI.
Ask why (optional LLM)
ask() reads the object you pass and explains it, grounded in the skforecast agent skills. It never changes the result. The dataset is never sent: a result shares only its own predictions and metrics, with a warning. Providers, credentials and local models are covered in Configuring the LLM.
From your coding agent (MCP server)
In Claude Code, install the server and its skill as a plugin:
Then ask in plain language: "Forecast the next 12 months of data/sales.csv and tell me how accurate it is." The agent brings the language model and calls skforecast-ai as tools; every decision still comes from the same deterministic rules, every result comes with the script that produced it, and responses never carry rows of your data. The setups for Cursor, VS Code, Codex and Claude Desktop are in MCP server for coding agents.
Features
A deterministic engine
- Data profiling: frequency, missing values, exogenous and categorical variables, and the significant lags from the partial autocorrelation.
- A plan with a rule for every decision: forecaster and estimator, lags, window and calendar features, prediction intervals, metric and cross-validation.
- The code you see is the code that ran:
forecast()andbacktest()execute the same script thatforecast_code()andbacktest_code()return. Inspect it, version it or run it with plain skforecast. - Model selection with
compare(): every candidate is backtested with the same data and cross-validation, and the ranking is a plain sort of the metric. For a single series, a seasonal naive baseline is ranked alongside them, so you also see whether a model beats the simplest reasonable forecast. - Reproducible: the same input always gives the same profile, plan, script and predictions.
- Python or terminal: the CLI runs the same pipeline from a CSV file or URL.
- Coding agents: an MCP server gives Claude Code, Cursor and other MCP clients the same pipeline as tools, with a skill that teaches them to use it. Responses never carry rows of your data.
The engine chooses among the forecasters of skforecast: recursive and direct, multi-series and multivariate, statistical (ARIMA) and foundation models.
An optional LLM layer
- Explains a forecast, a backtest, a comparison, a plan or a script in plain language with
ask(), or answers a general forecasting question. - Refines lags and window features from your domain knowledge with
refine_plan(prompt=...). - Translates a deployment scenario into a backtesting strategy with
create_cv(prompt=...). - Validated before it runs: every LLM output is checked by a Pydantic model; if it is not valid, you get the deterministic result and a warning.
- Any provider through pydantic-ai: OpenAI, Anthropic, Google, Groq, AWS Bedrock, Ollama for local models, or any OpenAI-compatible endpoint.
Methods
All methods work without an LLM except ask(). A prompt is always explicit: nothing is sent to an LLM unless you ask for it.
How it works
skforecast-ai has two ways in, on the same engine. The fast path goes from data to a forecast or a backtest in one call. The step-by-step path returns each intermediate object (profile, plan, cross-validation) so you can inspect it, change it or refine it with the LLM before running anything. Both branch into forecasting and backtesting, compare() picks the best configuration from measured performance, and ask() explains any object along the way.
Read more in Agentic forecasting and Agentic forecasting step by step.
Documentation
The full documentation is available at https://ai.skforecast.org.
Part of the skforecast family
[Skforecast Docs] [GitHub] [Skforecast Studio]
- skforecast: the forecasting library that runs every forecast of skforecast-ai. Machine learning, statistical and foundation models, backtesting and tuning.
- Skforecast Studio: a no-code application to build forecasting models visually, which generates production-ready Python code.
Contributing
Bug reports, feature requests, code, tests and documentation are all welcome. Open an issue on GitHub Issues or read the Contribution Guide and the Code of Conduct to get started.
skforecast-ai is created and maintained by Joaquín Amat Rodrigo and Javier Escobar Ortiz, together with everyone who has contributed to it (about the project).
[skforecast-ai contributors]Citation
If you use skforecast-ai in a scientific publication, please cite the version you used: each version has its own DOI and ready-made citations on Zenodo. To cite skforecast-ai in general, use the DOI that always resolves to the latest release.
APA:
BibTeX:
The citation metadata is also in CITATION.cff (GitHub's "Cite this repository" button).
Sponsorship and funding
skforecast-ai is built by the skforecast team. skforecast is free, open-source software supported by the Sovereign Tech Fund and by the organizations that sponsor it. If your company relies on skforecast or skforecast-ai, see Sponsorship and funding for sponsorship tiers, support agreements, feature sponsorship and training.
Individuals can support the project through Open Collective, Buy Me a Coffee, GitHub Sponsors (Joaquín Amat Rodrigo, Javier Escobar Ortiz) or PayPal.
[Support skforecast on Open Collective] [Buy Me a Coffee] [Sponsor skforecast on GitHub]
License
skforecast-ai software: Apache License 2.0. The underlying skforecast engine is distributed under its own BSD-3-Clause License.
skforecast-ai documentation: CC BY-NC-SA 4.0
Trademark: The trademark skforecast is registered with the European Union Intellectual Property Office (EUIPO) under the application number 019109684. Unauthorized use of this trademark, its logo, or any associated visual identity elements is strictly prohibited without the express consent of the owner.
來源:README.md,提交 1fb1c08
工具
0版本歷史
1- v0.4.0最新Oct 9, 2026


