def _get_scorings(self):
"""Get scorings for this problem type.
Returns
-------
scorings : list of dict
Information on metric name and associated "scoring" as defined in
sklearn.metrics
scorings_ : list
List of "scoring" as defined in sklearn.metrics. This is a "utility
variable" that can be used where we just need the names of the
scoring functions and not the more complete information.
"""
# scoring_types maps user-readable name to `scoring`, as argument to
# cross_val_score
# See also http://scikit-learn.org/stable/modules/model_evaluation.html#scoring-parameter
if self._is_classification():
scorings = Model.CLASSIFICATION_SCORING
scorings_= [s["scoring"] for s in scorings]
elif self._is_regression():
scorings = Model.REGRESSION_SCORING
scorings_= [s["scoring"] for s in scorings]
else:
raise NotImplementedError
return scorings, scorings_
评论列表
文章目录