1 Star 1 Fork 0

far/LSTM_GoogleClusterTraceData

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
seasonalAdjustment.py 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
thangbk2209 提交于 2017-11-21 22:18 . fix structure to check code
import numpy as np
import pandas as pd
from pandas import Series,read_csv
from matplotlib import pyplot as plt
colnames = ['time_stamp', 'CPU']
original = read_csv('data/Fuzzy_CPU_sampling_617685_metric_10min_datetime_origin.csv',names = colnames)
originalData = original['CPU']
originalData = np.array(originalData)
seasonal = read_csv('data/seasonalCPU10minutes.csv',names=['CPU'])
seasonalData = seasonal['CPU']
seasonalData = np.array(seasonalData)
trend_na = read_csv('data/trendCPU10minutes.csv',names=['CPU'])
trend = trend_na.fillna(0)['CPU']
print seasonalData
print len(seasonalData)
print len(originalData)
print 'dsfads'
print len(trend)
deseasonal = []
for i in range(len(originalData)):
deseasonal.append(originalData[i] - seasonalData[i]-trend[i])
print deseasonal
ax = plt.subplot()
ax.plot(originalData,label="Original")
ax.plot(deseasonal,label="deseasonal")
# ax.plot(TestPred,label="Test")
plt.xlabel("TimeStamp")
plt.ylabel("Mem")
plt.legend()
# plt.savefig('3layers64-32-16/batchsize=%s.png'%(batch_size))
plt.show()
deseasonalDf = pd.DataFrame(np.array(deseasonal))
deseasonalDf.to_csv('data/deseasonalCPU10minutes.csv', index=False, header=None)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/littlefar/LSTM_GoogleClusterTraceData.git
git@gitee.com:littlefar/LSTM_GoogleClusterTraceData.git
littlefar
LSTM_GoogleClusterTraceData
LSTM_GoogleClusterTraceData
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385