Beispiel #1
0
pyplot.clf()
pyplot.figure(2)
pyplot.ylim(0, compare['y_test'].max())
pyplot.xlim(0, compare['y_test'].max())
pyplot.scatter(compare['y_test'], compare['y_pred'], c='red', alpha=0.05, s=3)
pyplot.xlabel('Actual', fontsize=18)
pyplot.ylabel('Predicted', fontsize=16)
pyplot.suptitle(projectName + " " + id)
pyplot.title('RMSE: ' + str(rmse))
pyplot.savefig(projectPath + "/accuracy_variance" + "_run" + str(exe_count) +
               ".pdf")

# ------------------------------------------------------
# Save results
# ------------------------------------------------------
with open(trainingInfoFilePath, "a") as f:
    f.write("Mean error in days: " + str(compare['abs_dff'].mean()))
    f.close()

model.save(rootFolder + id + "_" + "weights.hdf5")

return_model = str(model.to_json())

result = {
    'status': 'completed',
    'orderId': assignment_id,
    'loss': str(loss),
    'metric': str(metric)
}
print(str(json.dumps(result)))