时间序列发生器

time-series-generator的Python项目详细描述


时间序列发生器

PyPI versionDocumentation StatustraviscodecovGitHub license

说明

模拟Teras Tensorflow TimeSeriesGenerator功能,为Keras版本中的直接多步输出限制提供一个候选解决方案。在

安装

pip install time-series-generator

使用

^{pr2}$

试验

在终端项目根文件夹中运行:

pytest

Keras版本限制

A limitation of the Keras TimeseriesGenerator is that it does not directly support multi-step outputs. Specifically, it will not create the multiple steps that may be required in the target sequence.

Nevertheless, if you prepare your target sequence to have multiple steps, it will honor and use them as the output portion of each sample. This means the onus is on you to prepare the expected output for each time step.

布朗利,杰森

建议的候选改进

添加关键字参数length_output。在

# define datasetseries=np.array([1,2,3,4,5,6,7,8,9,10])target=np.array([1,2,3,4,5,6,7,8,9,10])# define generatorn_input=2n_output=2generator=TimeseriesGenerator(series,target,length=n_input,length_output=n_output,batch_size=1)# print each sampleforiinrange(len(generator)):x,y=generator[i]print('%s => %s'%(x,y))

输出

[[1 2]] => [[3 4]]
[[2 3]] => [[4 5]]
[[3 4]] => [[5 6]]
[[4 5]] => [[6 7]]
[[5 6]] => [[7 8]]
[[6 7]] => [[8 9]]
[[7 8]] => [[9 10]]

参考文献

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
尝试连接到Red5服务器时出现java问题   java实现Runnable的类被认为是ExecutorServices的“Runnable任务”?   java struts2类中的多个@validation   java未能应用插件[class'org.gradle.api.plugins.scala.ScalaBasePlugin']:gradle v2。13   如何使用Java流仅收集长度最大的元素?   从spring引导应用程序连接到firestore的java引发空指针异常   java从SQLite插入和获取真实数据类型会为连续插入获取空值吗?   当存在未知数量的空格时,使用java替代正向查找   部署如何为当今的浏览器部署java小程序(小程序、嵌入、对象)?   @OneToMany和@ManyToOne@Formula之间的java双向关系返回null   java为什么在我的例子中,协议缓冲区的性能比JSON差?   如何部署混合C++/Java(JNI)应用程序?   java如何在程序中显示字符串的完整信息。反恐精英?   java在Hibernate中从持久性上下文中分离实体中的实体