<jupyter_start><jupyter_text>Visualizing Dataset<jupyter_code>fig=plt.figure(figsize=(12,8))
plt.title("Task vs Time")
plt.xlabel("Time interval")
plt.ylabel("Number of instances")
plt.plot(df2.time_interval, df2.no_of_instances)
plt.show()
#Computational Time
import time
time_start = time.clock()

#Code
a1=0.1
a2=0.1
a3=0.1
a4=0.1
a5=0.6

X = df2.no_of_instances
Begin=5
predictions=list()
times=list()
SE=0
sumAPE=0
#sumMASE=0
#test=[X[i] for i in range(Begin,len(X)]
for i in range (Begin,len(X)):
    Ft=np.int(a1*df2.no_of_instances[i-5]+a2*df2.no_of_instances[i-4]+a3*df2.no_of_instances[i-3]+a4*df2.no_of_instances[i-2]+a5*df2.no_of_instances[i-1])
    predictions.append(Ft)
    Ft_prev=Ft
    times.append(df2.time_interval[i])
    print('Time, predicted, expected \n',df2.time_interval[i], Ft, df2.no_of_instances[i])
    e=abs(Ft-df2.no_of_instances[i])
    SE=SE+e*e
    APE=abs((Ft-df2.no_of_instances[i])/df2.no_of_instances[i])
    sumAPE=sumAPE+APE
    #ASE=abs((yhat-obs)/(test[t]-df2.no_of_instances[t-1]))
    #sumMASE=sumMASE+ASE
RMSE=math.sqrt(SE/len(X)-Begin)
MAPE=(sumAPE/(len(X)-Begin))*100
#MASE=(sumMASE/(len(X)))
print('RMSE Value= ', RMSE)
print('MAPE Value= ', MAPE)
#print('MASE Value= ', MASE)
    
#print('Time= \n', times)
#print('Predictions= \n', predictions)

#Computational Time
time_elapsed = (time.clock() - time_start)
print('Computational Time=', time_elapsed)

# plot
fig=plt.figure(figsize=(12,8))
plt.title("Predicted vs Expected- - Weighted Moving Average")
plt.xlabel("Time interval")
plt.ylabel("Number of instances")
plt.plot(times, predictions, color='red', label='Predicted', linestyle='dashed')
plt.plot(df2.time_interval, df2.no_of_instances, color='blue', label='Original', linestyle='solid')
plt.legend()
plt.show()<jupyter_output>Time, predicted, expected 
 15 9254 8375
Time, predicted, expected 
 18 12100 14431
Time, predicted, expected 
 21 9926 29231
Time, predicted, expected 
 24 20249 26181
Time, predicted, expected 
 27 21342 62225
Time, predicted, expected 
 30 45156 16371
Time, predicted, expected 
 33 23029 13337
Time, predicted, expected 
 36 21403 24957
Time, predicted, expected 
 39 26785 22465
Time, predicted, expected 
 42 25168 33509
Time, predicted, expected 
 45 27818 27614
Time, predicted, expected 
 48 25995 37844
Time, predicted, expected 
 51 33560 29999
Time, predicted, expected 
 54 30142 18792
Time, predicted, expected 
 57 24171 97007
Time, predicted, expected 
 60 69629 69360
Time, predicted, expected 
 63 59980 58208
Time, predicted, expected 
 66 56440 30980
Time, predicted, expected 
 69 42924 24095
Time, predicted, expected 
 72 40012 15465
Time, predicted, expected 
 75 27543 47854
Time, predicted, expected 
 78 41587 28770
Time, predicted, expected 
 81 29101 31513
Time, predicte[...]
{'fraction_non_alphanumeric': 0.13717765042979943, 'fraction_numerical': 0.11783667621776504, 'mean_word_length': 5.5717647058823525, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '235529', 'license': 'MIT', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1058, 'n_words': 249, 'path': 'Weighted Moving Average.ipynb', 'repo_name': 'hhs0309/Workload-Prediction-Using-Alibaba-Cluster-Dataset', 'size': '2792'}