Python - 如何标准化时间序列数据

Python - how to normalize time-series data(Python - 如何标准化时间序列数据)
本文介绍了Python - 如何标准化时间序列数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个时间序列示例的数据集.我想计算各种时间序列示例之间的相似性,但是我不想考虑由于缩放引起的差异(即我想查看时间序列形状的相似性,而不是它们的绝对值).因此,为此,我需要一种标准化数据的方法.也就是说,使所有时间序列示例都落在某个区域之间,例如 [0,100].谁能告诉我如何在 python 中做到这一点

I have a dataset of time-series examples. I want to calculate the similarity between various time-series examples, however I do not want to take into account differences due to scaling (i.e. I want to look at similarities in the shape of the time-series, not their absolute value). So, to this end, I need a way of normalizing the data. That is, making all of the time-series examples fall between a certain region e.g [0,100]. Can anyone tell me how this can be done in python

推荐答案

假设你的时间序列是一个数组,试试这样:

Assuming that your timeseries is an array, try something like this:

(timeseries-timeseries.min())/(timeseries.max()-timeseries.min())

这会将您的值限制在 0 和 1 之间

This will confine your values between 0 and 1

这篇关于Python - 如何标准化时间序列数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Seasonal Decomposition of Time Series by Loess with Python(Loess 用 Python 对时间序列进行季节性分解)
Resample a time series with the index of another time series(使用另一个时间序列的索引重新采样一个时间序列)
How can I simply calculate the rolling/moving variance of a time series in python?(如何在 python 中简单地计算时间序列的滚动/移动方差?)
How to use Dynamic Time warping with kNN in python(如何在python中使用动态时间扭曲和kNN)
Keras LSTM: a time-series multi-step multi-features forecasting - poor results(Keras LSTM:时间序列多步多特征预测 - 结果不佳)
Python pandas time series interpolation and regularization(Python pandas 时间序列插值和正则化)