diff --git a/skorch/callbacks/scoring.py b/skorch/callbacks/scoring.py index 23c1782c1..4700fa999 100644 --- a/skorch/callbacks/scoring.py +++ b/skorch/callbacks/scoring.py @@ -100,7 +100,7 @@ def convert_sklearn_metric_function(scoring): # those are scoring objects returned by make_scorer starting # from sklearn 0.22 - scorer_names = ('_PredictScorer', '_ProbaScorer', '_ThresholdScorer') + scorer_names = ('_PredictScorer', '_ProbaScorer', '_ThresholdScorer', '_Scorer') if ( hasattr(module, 'startswith') and module.startswith('sklearn.metrics.') and diff --git a/skorch/classifier.py b/skorch/classifier.py index b7f552eaf..82707367b 100644 --- a/skorch/classifier.py +++ b/skorch/classifier.py @@ -97,7 +97,7 @@ def classes_(self): if not len(self.classes): raise AttributeError("{} has no attribute 'classes_'".format( self.__class__.__name__)) - return self.classes + return np.asarray(self.classes) try: return self.classes_inferred_ @@ -301,7 +301,7 @@ def _default_callbacks(self): @property def classes_(self): - return [0, 1] + return np.array([0, 1]) # pylint: disable=signature-differs def check_data(self, X, y): diff --git a/skorch/net.py b/skorch/net.py index 32dfec7b2..1e1caa2b6 100644 --- a/skorch/net.py +++ b/skorch/net.py @@ -1597,7 +1597,7 @@ def predict_proba(self, X): yp = nonlin(yp) y_probas.append(to_numpy(yp)) y_proba = np.concatenate(y_probas, 0) - return y_proba + return y_proba.astype(np.float64) def predict(self, X): """Where applicable, return class labels for samples in X.