Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use log loss in sklearn grid search

I am trying use grid search with log loss. Following is my code.

df = pd.read_csv(file_name)
df.shape # (146614, 395)
# All features are float32
gbm = GradientBoostingClassifier(max_features="log2")
GSCV = GridSearchCV(gbm, param, scoring=log_loss, n_jobs=2, cv =2, verbose=3)
GSCV.fit(df, y)
clf.grid_scores_

However, I am not able to run code. It give me error after long time at GSCV.fit line. however, when I drop scoring = log_loss it works fine.

Can anyone give me advice?

like image 551
Kush Patel Avatar asked Nov 29 '22 23:11

Kush Patel


1 Answers

Try scoring='neg_log_loss' in sklearn > 0.18

like image 195
M_D Avatar answered Dec 04 '22 16:12

M_D