我有一个多变量时间序列,该模型以pandas数据帧为模型,以应用递归神经元网络,该数据帧需要按时间索引排序。然后,在应用模型后,对测试集进行预测,意味着采用相同的排序方式。母鸡,必须恢复秩序。
说数据就像
+======================================================================================================================================================================================+
| index, target, feature1, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12, feature13, feature14, feature15, feature16 |
+======================================================================================================================================================================================+
| 2014-01-01, 1, 12, 0.006750, 21.192372, 39.119279, 0, 0, 0, 0, 13.602740, 117691.0, 0.06, 17259.0, 61491.0, 10.960000, 44620.0, |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2013-01-01, 1, 12, 0.256899, 21.192372, 39.119279, 0, 0, 0, 0, 30.282192, 835.0, 0.06, 221.0, 344.0, 10.004412, 406.0, |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2012-01-01, 0, 12, 0.000500, 21.192372, 39.119279, 0, 0, 0, 0, 30.282192, 49292.0, 0.04, 10853.0, 22945.0, 10.004412, 20132.0, |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
训练和预测有序数据集
+======================================================================================================================================================================================+
| index, target, feature1, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12, feature13, feature14, feature15, feature16 |
+======================================================================================================================================================================================+
| 2012-01-01, 0, 12, 0.000500, 21.192372, 39.119279, 0, 0, 0, 0, 30.282192, 49292.0, 0.04, 10853.0, 22945.0, 10.004412, 20132.0, |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2013-01-01, 1, 12, 0.256899, 21.192372, 39.119279, 0, 0, 0, 0, 30.282192, 835.0, 0.06, 221.0, 344.0, 10.004412, 406.0, |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2014-01-01, 1, 12, 0.006750, 21.192372, 39.119279, 0, 0, 0, 0, 13.602740, 117691.0, 0.06, 17259.0, 61491.0, 10.960000, 44620.0, |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
然后恢复预测变量的顺序。