1
scores = cross_val_score(logmodel,y_test.astype(float).reshape(-1, 1),predictions.reshape(-1, 1),
scoring="neg_mean_squared_error",cv=10)
log_rmse_scores = np.sqrt(-scores)
def display_scores(scores):
print("Scores: ", scores)
print("Mean: ",scores.mean())
print("Standard Deviation: ", scores.std())
display_scores(log_rmse_scores)
Exit:
Scores: [0.02972702 0.02972702 0.02972702 0.02972702 0.02972702 0.02972702
0.02972775 0.02972775 0.02972775 0.02972775]
Mean: 0.029727313479823336
Standard Deviation: 3.574977450912211e-07
From what I understand, this is still not the best model: I need to "Tunar" the model seeking the best hyperparameters with Grid Search, that’s right?
What are these hyperparameters in logistic regression? At the end of the process, what will be the model?
I don’t understand what I get in the end.
have 47 columns/Features. What would be the regularization?
– Ed S
Regularization is when you put in your loss function a penalty on the magnitude of the estimated weights. In general, the strength of this penalty is chosen via cross-validation. You can do what is called RFE (Recursive Feature Elimination) via cross-validation as well to find a model that uses fewer variables.
– Daniel Falbel