本文整理汇总了Python中DataManager.DataManager.chunkifyDataWindow方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.chunkifyDataWindow方法的具体用法?Python DataManager.chunkifyDataWindow怎么用?Python DataManager.chunkifyDataWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager.DataManager
的用法示例。
在下文中一共展示了DataManager.chunkifyDataWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DataManager
# 需要导入模块: from DataManager import DataManager [as 别名]
# 或者: from DataManager.DataManager import chunkifyDataWindow [as 别名]
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
from DataManager import DataManager
# Prep the data
chunkLen = 200
predGap = 8
histLen = 3
includeDst = True
dataManager = DataManager()
print("predGap = {} hours".format(predGap))
print("histLen = {} hours".format(histLen))
print("includeDst = {}".format(includeDst))
trainInput, trainTarget, validInput, validTarget, testInput, testTarget = \
dataManager.chunkifyDataWindow(chunkLen, predGap, histLen, includeDst)
# Find the goodness for simple DST shifting as a compaison
splitDate = (2004,1,21,0)
ctrainInput, ctrainTarget, ctestInput, ctestTarget = \
dataManager.genDataForModel(predGap, histLen, splitDate)
pRef = pearsonr(ctestTarget[predGap:], ctestTarget[0:-predGap])
RMSERef = np.sqrt(mean_squared_error(ctestTarget[predGap:], ctestTarget[0:-predGap]))
print("Reference RMSE: {}".format(RMSERef*dataManager.dstNorm))
print("Reference p: {}".format(pRef[0]))
# Network parameters
recSize = 4 if includeDst else 3
nInputs = (histLen+1)*recSize
hiddenNodes = 14
epochs = 500