'I'd like use pearson metric in GridSearch
For Kaggle submission, I need to test my model with pearson indice from scipy. I did this code, but the return is only NaN for mean_train_score and mean_test_score: Who has better idea ?
from scipy.stats import pearsonr
from sklearn.linear_model import LinearRegression
parameters = {}
lr = GridSearchCV(LinearRegression(),
parameters,
scoring=pearsonr,
cv=5,
n_jobs=-1, pearson indice
return_train_score=True)
lr.fit(X_train, y_train)
lr.cv_results_
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
