1 Star 1 Fork 0

far/LSTM_GoogleClusterTraceData

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
estimate_autocorrelation.py 943 Bytes
一键复制 编辑 原始数据 按行查看 历史
thangbk2209 提交于 2017-11-21 22:18 . fix structure to check code
from numpy import *
import numpy as np
import pylab as P
from matplotlib import pyplot as plt
from pandas import read_csv
# fn = 'data.txt'
# x = loadtxt(fn,unpack=True,usecols=[1])
# time = loadtxt(fn,unpack=True,usecols=[0])
colnames = ['cpu_rate','mem_usage','disk_io_time','disk_space']
# series = Series.from_csv('data/Fuzzy_data_resource_JobId_6336594489_5minutes.csv', header=0)
df = read_csv('data/Fuzzy_data_resource_JobId_6336594489_5minutes.csv', header=None, index_col=False, names=colnames, engine='python')
CPU = df['cpu_rate'].values
def estimated_autocorrelation(x):
n = len(x)
variance = x.var()
x = x-x.mean()
r = np.correlate(x, x, mode = 'full')[-n:]
#assert N.allclose(r, N.array([(x[:n-k]*x[-(n-k):]).sum() for k in range(n)]))
result = r/(variance*(np.arange(n, 0, -1)))
return result
plt.plot(estimated_autocorrelation(CPU))
plt.xlabel('time (s)')
plt.ylabel('autocorrelation')
plt.show()
马建仓 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