<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()<jupyter_output><empty_output><jupyter_text>Exponential Smoothing<jupyter_code>#Computational Time
import time
time_start = time.clock()

#Code
z=0.5
Ft_prev=df2.no_of_instances[0]
print('Ft previous value=',Ft_prev)
X = df2.no_of_instances
predictions=list()
times=list()
SE=0
sumAPE=0
#sumMASE=0

for i in range (1,len(X)):
    Ft=np.int(z*df2.no_of_instances[i-1]+(1-z)*Ft_prev)
    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))
MAPE=(sumAPE/(len(X)))*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- - Exponential Smoothing")
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>Ft previous value= 300
Time, predicted, expected 
 3 300 66450
Time, predicted, expected 
 6 33375 1
Time, predicted, expected 
 9 16688 1
Time, predicted, expected 
 12 8344 4299
Time, predicted, expected 
 15 6321 8375
Time, predicted, expected 
 18 7348 14431
Time, predicted, expected 
 21 10889 29231
Time, predicted, expected 
 24 20060 26181
Time, predicted, expected 
 27 23120 62225
Time, predicted, expected 
 30 42672 16371
Time, predicted, expected 
 33 29521 13337
Time, predicted, expected 
 36 21429 24957
Time, predicted, expected 
 39 23193 22465
Time, predicted, expected 
 42 22829 33509
Time, predicted, expected 
 45 28169 27614
Time, predicted, expected 
 48 27891 37844
Time, predicted, expected 
 51 32867 29999
Time, predicted, expected 
 54 31433 18792
Time, predicted, expected 
 57 25112 97007
Time, predicted, expected 
 60 61059 69360
Time, predicted, expected 
 63 65209 58208
Time, predicted, expected 
 66 61708 30980
Time, predicted, expected 
 69 46344 24095
Time, [...]
{'fraction_non_alphanumeric': 0.13202042304886943, 'fraction_numerical': 0.10722100656455143, 'mean_word_length': 5.690243902439025, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '478247', 'license': 'MIT', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1007, 'n_words': 245, 'path': 'ExponentialSmoothing.ipynb', 'repo_name': 'PriyadarshiniDas/Workload-Prediction-of-Alibaba-Cluster-Dataset', 'size': '2742'}