3
$\begingroup$

I'm running an XGBRegressor for parameter optimization as below:

xgb_model = xgb.XGBRegressor(nthread=10)
clf = pipeline.Pipeline([('xgb', xgb_model)])
param_grid = {'xgb__max_depth': [1,2,3],    
              'xgb__learning_rate': [0.2,0.3,0.4],  
              'xgb__n_estimators': [40,45,50]   
             }  

model = grid_search.GridSearchCV(estimator=clf, param_grid=param_grid, verbose=10, n_jobs=1,
                         iid=True, refit=True, cv=10)

model.fit(X, Y_log)

I see few 'scores' listed (can be +/-) in the console out of which the 'Best score' is chosen.

I want to understand what this 'score' is in a Regression setting, and how it is calculated.

Thanks!

$\endgroup$

1 Answer 1

3
$\begingroup$

Within the GridSearchCV you may choose your scoring type, ie "explained variation", "area under the ROC", etc...

The "sklearn model evaluation" module is highly complex and allows to choose between a complex set of evaluation approaches.

By default, the scoring method is set to None, taking the default estimator's scoring method if available.

When training a model with the train method, xgboost will provide the evals_result property that returns a dictionary which "eval_metric" key returns the evaluation metric used.

Also, when fitting with your booster, if you pass the eval_set value, then you may call the evals_result() method to get the same information.

For more details and ways of exploring this, I suggest you visit xgboost's API page and sklearn model evaluation pages on Internet.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.