From 07b474cefc1e13996c4e04d9bb1e9f3d54ce0e33 Mon Sep 17 00:00:00 2001 From: Dylan Werner-Meier Date: Thu, 25 Feb 2016 13:37:06 +0100 Subject: [PATCH] Fix issue #6298 Adds a "classes_" property to BaseSearchCV --- sklearn/grid_search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sklearn/grid_search.py b/sklearn/grid_search.py index 236ef6f411492..65902c526540d 100644 --- a/sklearn/grid_search.py +++ b/sklearn/grid_search.py @@ -386,6 +386,10 @@ def __init__(self, estimator, scoring=None, def _estimator_type(self): return self.estimator._estimator_type + @property + def classes_(self): + return self.best_estimator_.classes_ + def score(self, X, y=None): """Returns the score on the given data, if the estimator has been refit.