使用sktime进行时间序列分类第2部分

Note: This article is part 2 in the series of learning sktime. If you have not already read part 1 of this blog post, I highly recommend you guys to go and complete that article first if you want to understand part 2 of sktime.

注意:本文是学习sktime的系列文章的第2部分。 如果您还没有阅读此博客文章的第1部分,则强烈建议您先阅读这篇文章,如果您想了解sktime的第2部分。

Using Sktime for Time Series Forecasting(part 1)

使用Sktime进行时间序列预测(第1部分)

In our last article we saw how to install sktime and how to do time series forecasting using sktime, today we're going to see how to deal with time series classification problems using sktime.

在上一篇文章中,我们了解了如何安装sktime以及如何使用sktime进行时间序列预测,今天我们将了解如何使用sktime处理时间序列分类问题。

Today we going to see two types of classification:

今天我们将看到两种类型的分类:

  1. Univariate time series classification

    单变量时间序列分类

  2. Multivariate time series classification

    多元时间序列分类

Note: If you are reading this article I am sure that we share similar interests and will be in similar industries.. I would suggest few of my personal favourite courses and insist to complete this amazing course by DataCamp which i have taken on my journey to become a Data Scientist.

注意:如果您正在阅读本文,我相信我们会拥有相同的兴趣并且会从事类似的行业。.我将建议我最不喜欢的课程,并坚持完成DataCamp的这门令人惊奇的课程,这是我在旅途中成为数据科学家。

Here is a list of some of my favourite courses:

以下是一些我最喜欢的课程:

Supervised Learning with scikit-learns

scikit-learns的监督学习

Machine Learning with Tree-Based Models in Python

使用Python中基于树的模型进行机器学习

Hyperparameter Tuning in Python

Python中的超参数调整

Introduction to Data Visualization with Matplotlib

Matplotlib数据可视化简介

Introduction to Python

Python简介

Visualizing Time Series Data in Python

在Python中可视化时间序列数据

Forecasting in R

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
sktime提供了许多用于时间序列预测的模型和工具,例如ARIMA、SARIMA、ETS等。绘制时间序列预测图形的方法通常包括将实际数据和预测数据一起绘制,并使用不同的颜色或线型区分它们。 下面是一个简单的示例,演示如何使用sktime和Matplotlib绘制时间序列预测图形: ```python import matplotlib.pyplot as plt from sktime.forecasting.arima import AutoARIMA from sktime.datasets import load_airline # 加载航空公司乘客数据集 y = load_airline() # 拆分数据集 y_train, y_test = y[:120], y[120:] # 训练自动ARIMA模型 forecaster = AutoARIMA(sp=12, suppress_warnings=True) forecaster.fit(y_train) # 预测未来12个月的数据 y_pred = forecaster.predict(fh=[i for i in range(1, 13)]) # 绘制实际数据和预测数据的线图 plt.plot(y_train, label='train') plt.plot(y_test, label='test') plt.plot(y_pred, label='forecast') plt.title('Airline Passengers') plt.xlabel('Time') plt.ylabel('Passengers') plt.legend() plt.show() ``` 在这个示例中,我们首先使用sktime加载了航空公司乘客数据集,并将其拆分为训练集和测试集。然后,我们使用自动ARIMA模型来训练数据,并使用该模型预测未来12个月的数据。最后,我们将实际数据、测试数据和预测数据一起绘制在同一张图上,并使用不同的颜色区分它们。 您可以根据需要自定义这些图形,例如添加网格线、更改线条颜色或线型等。Matplotlib提供了许多选项,可以让您创建漂亮的时间序列预测图形。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值