y_hat_predicted = y_test rmse = compare(y_test, y_hat_predicted) print('RMSE NoPredic %.3f' % (rmse)) # Dummy y_predicted_dummy = x_train[:, 0] rmse = compare(y_train, y_predicted_dummy) print('RMSE Dummy %.3f' % (rmse)) # ElasticNet y_predicted_en = algorithm.elastic_net2(x_train, y_train, x_train) rmse = compare(y_train, y_predicted_en) print('RMSE Elastic %.3f' % (rmse)) # KNN5 y_predicted_knn5 = algorithm.knn_regressor(x_train, y_train, x_train, 5) rmse = compare(y_train, y_predicted_knn5) print('RMSE KNN(5) %.3f' % (rmse)) # KNN10 y_predicted_knn10 = algorithm.knn_regressor(x_train, y_train, x_train, 10) rmse = compare(y_train, y_predicted_knn10) print('RMSE KNN(10) %.3f' % (rmse)) # SGD y_predicted_sgd = algorithm.sgd_regressor(x_train, y_train, x_train) rmse = compare(y_train, y_predicted_sgd) print('RMSE SGD %.3f' % (rmse)) print('------- Test --------') # No Prediction
y_hat_predicted = y_train rmse, y_predicted = compare_train(x_test, y_hat_predicted) print('RMSE NoPredic %.3f' % (rmse)) # Dummy y_hat_predicted = x_train[:, 0] rmse, y_predicted = compare_train(x_test, y_hat_predicted) print('RMSE Dummy %.3f' % (rmse)) # ElasticNet y_hat_predicted = algorithm.elastic_net2(x_train, y_train, x_train, normalize=False) rmse, y_predicted = compare_train(x_test, y_hat_predicted) print('RMSE Elastic %.3f' % (rmse)) # KNN5 y_hat_predicted = algorithm.knn_regressor(x_train, y_train, x_train, 5) rmse, y_predicted = compare_train(x_test, y_hat_predicted) print('RMSE KNN(5) %.3f' % (rmse)) # KNN10 y_hat_predicted = algorithm.knn_regressor(x_train, y_train, x_train, 10) rmse, y_predicted = compare_train(x_test, y_hat_predicted) print('RMSE KNN(10) %.3f' % (rmse)) # SGD y_hat_predicted = algorithm.sgd_regressor(x_train, y_train, x_train) rmse, y_predicted = compare_train(x_test, y_hat_predicted) print('RMSE SGD %.3f' % (rmse)) # LSTM y_hat_predicted = algorithm.lstm(x_train, y_train, x_train, batch_size=1, nb_epoch=3, neurons=1)