<jupyter_start><jupyter_text>Test effect of number of simulation on MAE, MSE and training time<jupyter_code>num_exprs=[100,250,500,1000,2500,5000,10000,25000]#,50000,100000]
noise=0.01

#Define final MLP
model_single = MLPRegressor(random_state=1, max_iter=500,tol=0.001,early_stopping=True,activation='relu',alpha=0.000075,
               hidden_layer_sizes=(2048, 1024, 512, 256, 128, 64, 32),solver='adam',beta_1=0.5,beta_2=0.05,learning_rate='constant')
model = MultiOutputRegressor(model_single)
    
analysis_partial=partial(analysis_func_expnum,model=model,noise=noise)
p = Pool(processes=len(num_exprs))
results = p.map(analysis_partial, num_exprs)
p.close()
print(results)

#Save results
dump(results, 'mlp_number_of_sims_results.joblib')

#Load results
results=load('models/mlp_number_of_sims_results.joblib')
df_num_exp = pd.DataFrame.from_records(
    results, columns=['Number of Experiments', "Fitting Time (sec)","Prediction Time (sec)","MSE Diameter","MSE SD","MAE Diameter","MAE SD"])
perform_plot(df_num_exp)<jupyter_output><empty_output><jupyter_text>Test effect of MLP complexity (number of layers number of nodes) to MAE, MSE,training time and prediction time<jupyter_code>num_exprs=10000
noise=0.01
layers=[(64, 32),(128, 64, 32),(256, 128, 64, 32),(512, 256, 128, 64, 32),(1024, 512, 256, 128, 64, 32),(2048, 1024, 512, 256, 128, 64, 32),(4096,2048, 1024, 512, 256, 128, 64, 32)]

analysis_partial=partial(analysis_func_layers,num_exprs=num_exprs,noise=noise)
p = Pool(processes=len(layers))
results = p.map(analysis_partial, layers)
p.close()
print(results)
#Save results
dump(results, 'mlp_number_of_layers_results.joblib')

#Load results
results=load('models/mlp_number_of_layers_results.joblib')
df_layers = pd.DataFrame.from_records(
    results, columns=["Layers", "Fitting Time (sec)","Prediction Time (sec)","MSE Diameter","MSE SD","MAE Diameter","MAE SD"])
df_layers["Layers"]=df_layers["Layers"].apply(lambda x: len(x))
df_layers

perform_plot(df_layers)<jupyter_output><empty_output><jupyter_text>Test effect of signal's noise on MAE and MSE<jupyter_code>num_exprs=10000
noise=[0.001,0.0025,0.005,0.01,0.025,0.05,0.1,0.25,0.5]
#Define final MLP
model_single = MLPRegressor(random_state=1, max_iter=500,tol=0.001,early_stopping=True,activation='relu',alpha=0.000075,
               hidden_layer_sizes=(512, 256, 128, 64, 32),solver='adam',beta_1=0.5,beta_2=0.05,learning_rate='constant')
model = MultiOutputRegressor(model_single)
analysis_partial=partial(analysis_func_noise,model=model,exp=num_exprs)
p = Pool(processes=len(noise))
results = p.map(analysis_partial, noise)
p.close()
print(results)
#Save results
dump(results, 'mlp_noise_results.joblib')

#Load results
results=load('models/mlp_noise_results.joblib')
df_noise = pd.DataFrame.from_records(
    results, columns=["Noise %", "Fitting Time (sec)","Prediction Time (sec)","MSE Diameter","MSE SD","MAE Diameter","MAE SD"])
df_noise["Noise %"]=df_noise["Noise %"]*100
perform_plot(df_noise)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15262110152621103, 'fraction_numerical': 0.08825481088254811, 'mean_word_length': 9.016611295681063, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '165280', 'license': 'MIT', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1121, 'n_words': 192, 'path': 'MLP_Analysis.ipynb', 'repo_name': 'kziovas/UniOfPiraeusMScThesisProject', 'size': '3014'}