当前位置: 首页 > news >正文

sktime - 时间序列机器学习统一接口

文章目录

    • 一、关于 sktime
      • 1、项目概览
      • 2、相关链接资源
    • 二、功能特性
      • 1、核心模块
      • 2、生态系统集成
    • 三、安装配置
      • 1、pip安装
      • 2、conda安装
    • 四、快速入门
      • 1、时间序列预测示例
      • 2、时间序列分类示例
    • 五、社区参与


一、关于 sktime

1、项目概览

sktime 是一个 Python 时间序列分析库,为多种时间序列学习任务提供统一接口。当前支持的功能包括:

  • 时间序列预测
  • 时间序列分类
  • 时间序列聚类
  • 异常/变化点检测
  • 其他相关任务

该库提供时间序列算法和兼容[scikit-learn]的工具,用于构建、调优和验证时间序列模型。


2、相关链接资源

  • Github:https://github.com/sktime/sktime
  • 官网:https://www.sktime.net
  • 官方文档:https://www.sktime.net/en/stable/users.html
  • 教程:https://www.sktime.net/en/stable/examples.html
  • Binder Notebooks:https://mybinder.org/v2/gh/sktime/sktime/main?filepath=examples
  • YouTube 教程:https://www.youtube.com/playlist?list=PLKs3UgGjlWHqNzu0LEOeLKvnjvvest2d0
  • 社区支持:
    • Discord:https://discord.com/invite/54ACzaFsn7
    • Stack Overflow:https://stackoverflow.com/questions/tagged/sktime
    • LinkedIn:https://www.linkedin.com/company/scikit-time/
  • License:BSD 3-Clause
  • 版本状态:
    • PyPI:https://pypi.org/project/sktime/
    • Conda:https://anaconda.org/conda-forge/sktime
  • 引用:Zenodo

二、功能特性

1、核心模块

模块状态资源链接
预测(Forecasting)稳定教程 · API
时间序列分类稳定教程 · API
时间序列回归稳定API
时间序列转换稳定教程 · API
异常检测成熟中模板
时间序列聚类成熟中API

2、生态系统集成

与以下库实现互操作:

  • scikit-learn
  • statsmodels
  • tsfresh
  • PyOD
  • fbprophet

三、安装配置

1、pip安装

# 基础安装
pip install sktime# 完整功能安装
pip install sktime[all_extras]# 按需安装特定模块
pip install sktime[forecasting]  # 仅预测相关依赖
pip install sktime[forecasting,transformations]  # 预测+转换

2、conda安装

conda install -c conda-forge sktime# 完整功能安装
conda install -c conda-forge sktime-all-extras

四、快速入门

1、时间序列预测示例

from sktime.datasets import load_airline
from sktime.forecasting.base import ForecastingHorizon
from sktime.forecasting.theta import ThetaForecaster
from sktime.split import temporal_train_test_split
from sktime.performance_metrics.forecasting import mean_absolute_percentage_errory = load_airline()
y_train, y_test = temporal_train_test_split(y)
fh = ForecastingHorizon(y_test.index, is_relative=False)
forecaster = ThetaForecaster(sp=12)  # monthly seasonal periodicity
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
mean_absolute_percentage_error(y_test, y_pred)
>>> 0.08661467738190656

2、时间序列分类示例

from sktime.classification.interval_based import TimeSeriesForestClassifier
from sktime.datasets import load_arrow_head
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_scoreX, y = load_arrow_head()
X_train, X_test, y_train, y_test = train_test_split(X, y)
classifier = TimeSeriesForestClassifier()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
accuracy_score(y_test, y_pred)
>>> 0.8679245283018868

五、社区参与

  • 贡献指南:https://www.sktime.net/en/latest/get_involved/contributing.html
  • 开发者文档:https://www.sktime.net/en/latest/developer_guide.html
  • 社区会议:每周五13:00 UTC(Discord)
  • 捐赠支持:https://opencollective.com/sktime

伊织 xAI 2025-05-27(二)

http://www.dtcms.com/a/282638.html

相关文章:

  • Docker——Redis
  • ollama快速部署使用(windows版)
  • Linux三剑客grep、sed、awk
  • 海盗王如何拍摄和打包小地图
  • 在javaScript里删除节点以及添加节点
  • livecharts 装版本8
  • 预训练模型:大规模数据预学习范式——定义、原理与演进逻辑
  • CSS隐藏元素:display:none vs visibility:hidden
  • S7-200 SMART PLC:模拟量模块接线全解析
  • 新手向:自动化图片格式转换工具
  • PyCharm高效入门指南大纲
  • 如何在 Linux 上下载和安装 Conda/Miniconda
  • 基于 Docker 环境的 JupyterHub 详细部署手册
  • VR 污水厂初体验:颠覆传统认知​
  • 广州 VR 森林防火系统功能探究​
  • Harmony-Next鸿蒙实战开发项目-仿小米商城App----V2
  • DOM 规范中的 MutationObserver 接口
  • 【LeetCode 热题 100】543. 二叉树的直径——DFS
  • STM32 写选项字 关键要加载HAL_FLASH_OB_Launch
  • 红黑树、B树、B+树
  • 轻松将文件从 iPhone 传输到 Mac
  • 中医文化学习软件,传承国粹精华
  • Redis Key 设计原则
  • Excel转PDF的三种方法
  • 基于大数据的网络文学推荐分析系统的设计与实现【海量书籍、自动爬虫】
  • 《通信原理》学习笔记——第二章
  • AI进化论15:通用人工智能(AGI)的“终极梦想”与“潘多拉魔盒”
  • AI炒作,AGI或在2080年之前也无法实现,通用人工智能AGI面临幻灭
  • 基于 .Net Core+MySQL开发(WinForm)翻译平台
  • rLLM:用于LLM Agent RL后训练的创新框架