Good day. I want to organize a search on the grid GridSearchCV to find the optimal parameters for the classifier ExtraTreesClassifier . As a metric, I am interested in the Ginny criterion (that is, I would like to get the parameters for my classifier based on Ginny). But in the description ( http://scikit-learn.org/stable/modules/model_evaluation.html ) it is not. How can I set my metric and is it possible?
|
1 answer
It is quite possible.
See the Defining your scoring strategy from metric functions item in the documentation .
Example ( l_inf-norm ):
import numpy as np def my_custom_loss_func(ground_truth, predictions): diff = np.abs(ground_truth - predictions).max() return np.log(1 + diff) |