Plot Spectrum Noise
In [30]:
Copied!
import os
import pandas as pd
import matplotlib.pyplot as plt
import scienceplots
import matplotlib as mpl
import matplotlib
# Default settings
mpl.rcParams.update(mpl.rcParamsDefault)
# plt.style.use('science')
plt.style.use("seaborn-darkgrid")
plt.rcParams.update({'font.size': 14})
import os
import pandas as pd
import matplotlib.pyplot as plt
import scienceplots
import matplotlib as mpl
import matplotlib
# Default settings
mpl.rcParams.update(mpl.rcParamsDefault)
# plt.style.use('science')
plt.style.use("seaborn-darkgrid")
plt.rcParams.update({'font.size': 14})
C:\Users\dicky1031\AppData\Local\Temp\ipykernel_14136\779055010.py:10: MatplotlibDeprecationWarning: The seaborn styles shipped by Matplotlib are deprecated since 3.6, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-<style>'. Alternatively, directly use the seaborn API instead. plt.style.use("seaborn-darkgrid")
In [31]:
Copied!
result_folder = 'prediction_model_formula8'
result_folder = 'prediction_model_formula8'
In [32]:
Copied!
fix_noise_data = pd.read_csv(os.path.join('pic', result_folder, 'all_train_data_on_test_set','fix_noise_result.csv'))
fix_noise = fix_noise_data['noise']
fix_noise_RMSE = fix_noise_data['RMSE']
rand_noise_data = pd.read_csv(os.path.join('pic', result_folder, 'all_train_data_on_test_set','random_noise_result.csv'))
rand_noise = rand_noise_data['noise']
rand_noise_RMSE = rand_noise_data['RMSE']
fix_noise_data = pd.read_csv(os.path.join('pic', result_folder, 'all_train_data_on_test_set','fix_noise_result.csv'))
fix_noise = fix_noise_data['noise']
fix_noise_RMSE = fix_noise_data['RMSE']
rand_noise_data = pd.read_csv(os.path.join('pic', result_folder, 'all_train_data_on_test_set','random_noise_result.csv'))
rand_noise = rand_noise_data['noise']
rand_noise_RMSE = rand_noise_data['RMSE']
In [37]:
Copied!
plt.figure(figsize=(8,6))
plt.plot(fix_noise*100, fix_noise_RMSE, 'o-')
plt.title('spectrum with fixed noise')
plt.xlabel('fixed noise(%)')
plt.ylabel('prediction performance, RMSE(%)')
plt.savefig(os.path.join("pic", result_folder, "fixed_noise_result.png"), dpi=300, format='png', bbox_inches='tight')
plt.show()
plt.figure(figsize=(8,6))
plt.plot(fix_noise*100, fix_noise_RMSE, 'o-')
plt.title('spectrum with fixed noise')
plt.xlabel('fixed noise(%)')
plt.ylabel('prediction performance, RMSE(%)')
plt.savefig(os.path.join("pic", result_folder, "fixed_noise_result.png"), dpi=300, format='png', bbox_inches='tight')
plt.show()
In [38]:
Copied!
plt.figure(figsize=(8,6))
plt.plot(rand_noise*100, rand_noise_RMSE, 'o-')
plt.title('spectrum with random noise')
plt.xlabel('random noise(%)')
plt.ylabel('prediction performance, RMSE(%)')
plt.savefig(os.path.join("pic", result_folder, "random_noise_result.png"), dpi=300, format='png', bbox_inches='tight')
plt.show()
plt.figure(figsize=(8,6))
plt.plot(rand_noise*100, rand_noise_RMSE, 'o-')
plt.title('spectrum with random noise')
plt.xlabel('random noise(%)')
plt.ylabel('prediction performance, RMSE(%)')
plt.savefig(os.path.join("pic", result_folder, "random_noise_result.png"), dpi=300, format='png', bbox_inches='tight')
plt.show()