示例#1
0
    #print("The number of layers were: ",myfmodel.n_layers_)
    #print("The output activation function was ",myfmodel.out_activation_)

    #Percentage errors in each test data sample
    perror = 100.0 * (np.abs(ytest - yhat) / ytest)
    #find maximum percentage error
    maxperror = np.max(100.0 * (np.abs(ytest - yhat) / ytest))
    print("Maximum percet error = ", maxperror)
    #Plot the percentage errors
    #import matplotlib.pyplot as plt
    #from IPython import get_ipython
    #plt.plot(perror)
    #plt.show()
    #Plot the true and predicted Transmittance
    #get_ipython().run_line_magic('matplotlib', 'qt')
    plot_true_vs_pred(ytest, yhat, ytrain, ytrain_out, norm_lims, exp_str, j,
                      "", "")

export_csv = performance_out.to_csv(
    exp_str + "/" + r'Ynew_performances_1_2.csv', index=None,
    header=True)  #Don't forget to add '.csv' at the end of the path

pklfile = open(file=exp_str + "/train_learned_nh_" + str(num_hidden_neuron) +
               ".pkl",
               mode="rb")
obj = pickle.load(pklfile)
pklfile.close()
#See the Regression metrics section of the user guide for further details.
#
#metrics.explained_variance_score(y_true, y_pred)	Explained variance regression score function
#metrics.mean_absolute_error(y_true, y_pred)	Mean absolute error regression loss
#metrics.mean_squared_error(y_true, y_pred[, …])	Mean squared error regression loss
示例#2
0
    #print("The number of layers were: ",myfmodel.n_layers_)
    #print("The output activation function was ",myfmodel.out_activation_)

    #Percentage errors in each test data sample
    perror = 100.0 * (np.abs(ytest - yhat) / ytest)
    #find maximum percentage error
    maxperror = np.max(100.0 * (np.abs(ytest - yhat) / ytest))
    print("Maximum percet error = ", maxperror)
    #Plot the percentage errors
    #import matplotlib.pyplot as plt
    #from IPython import get_ipython
    #plt.plot(perror)
    #plt.show()
    #Plot the true and predicted Transmittance
    #get_ipython().run_line_magic('matplotlib', 'qt')
    plot_true_vs_pred(ytest, yhat, ytrain, ytrain_out, norm_lims, exp_str, j,
                      which_conc_feature, "")

export_csv = performance_out.to_csv(
    exp_str + "/" + r'Ynew_performances_1_1.csv', index=None,
    header=True)  #Don't forget to add '.csv' at the end of the path

pklfile = open(file=exp_str + "/train_learned_nh_" + str(num_hidden_neuron) +
               which_conc_feature + ".pkl",
               mode="rb")
obj = pickle.load(pklfile)
pklfile.close()
#metrics section of the user guide for further details.
#
#metrics.explained_variance_score(y_true, y_pred)	Explained variance regression score function
#metrics.mean_absolute_error(y_true, y_pred)	Mean absolute error regression loss
#metrics.mean_squared_error(y_true, y_pred[, …])	Mean squared error regression loss