From 5f82f43d55d30a673fa769495349bc8e5d5a6bf2 Mon Sep 17 00:00:00 2001 From: Aman Dalmia Date: Tue, 7 Feb 2017 00:36:12 +0530 Subject: [PATCH] ENH: minimize validation of X in adaboost --- sklearn/ensemble/weight_boosting.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sklearn/ensemble/weight_boosting.py b/sklearn/ensemble/weight_boosting.py index 307b7a93ffbed..eda7e7aa38cbe 100644 --- a/sklearn/ensemble/weight_boosting.py +++ b/sklearn/ensemble/weight_boosting.py @@ -102,14 +102,12 @@ def fit(self, X, y, sample_weight=None): if (self.base_estimator is None or isinstance(self.base_estimator, (BaseDecisionTree, BaseForest))): - dtype = DTYPE accept_sparse = 'csc' else: - dtype = None accept_sparse = ['csr', 'csc'] - X, y = check_X_y(X, y, accept_sparse=accept_sparse, dtype=dtype, - y_numeric=is_regressor(self)) + X, y = check_X_y(X, y, accept_sparse=accept_sparse, dtype=None, + allow_nd=True, y_numeric=is_regressor(self)) if sample_weight is None: # Initialize weights to 1 / n_samples