<jupyter_start><jupyter_text>3.6.2__MA__MODEL_<jupyter_code>#window size 
len_window = 200
# eztracting size of the trainig data
len_train_data = df.train.size
#creating a list to store prediciton values
pred_array = []
#creating a list to append date
pred_x_array = []
#list to store mse error values 
mse = []
#variable to store the number of stime steps
n_time_step_ = 0
#loop to repeat the prediction 
for i_pred in range(len_window, len_train_data):

    if i_pred >= len_train_data:
        date = dt.datetime.strptime(k, '%Y-%m-%d').date() + dt.timedelta(days=1)
    else:
        date = df.loc[i_pred, 'Date']
        
    pred_array.append(np.mean(df.train[i_pred - len_window:i_pred]))
    #adding error values to MSE list
    mse.append((pred_array[-1] - df.train[i_pred - n_time_step]) ** 2)
    count +=1
    pred_x_array.append(date)

#printing MSE
print('MSE error: %.4f' % (0.5 * np.mean(mse)))
#calcualting RMSE 
print('RMSE error: %.4f'% math.sqrt((0.5*np.mean(mse_errors))))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13294232649071358, 'fraction_numerical': 0.016617790811339198, 'mean_word_length': 4.12, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '372969', 'license': 'Apache-2.0', 'n_tokens_mistral': 406, 'n_tokens_neox': 397, 'n_words': 93, 'path': 'SourceCodes/3_6_2_MA_Models.ipynb', 'repo_name': 'AlirezaGhanbarzadehUM/Research_Project_WQD7002', 'size': '1023'}