Skip to content

Commit 0188e68

Browse files
committed
Merge pull request scikit-learn#5684 from amueller/deprecated_float_indexing_rfe
[MRG+1] Don't use floats to index numpy arrays
2 parents f7e886a + 2a98fc6 commit 0188e68

File tree

1 file changed

+2
-3
lines changed
  • sklearn/feature_selection

1 file changed

+2
-3
lines changed

sklearn/feature_selection/rfe.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
"""Recursive feature elimination for feature ranking"""
88

9-
import warnings
109
import numpy as np
1110
from ..utils import check_X_y, safe_sqr
1211
from ..utils.metaestimators import if_delegate_has_method
@@ -129,7 +128,7 @@ def _fit(self, X, y, step_score=None):
129128
# Initialization
130129
n_features = X.shape[1]
131130
if self.n_features_to_select is None:
132-
n_features_to_select = n_features / 2
131+
n_features_to_select = n_features // 2
133132
else:
134133
n_features_to_select = self.n_features_to_select
135134

@@ -282,7 +281,7 @@ class RFECV(RFE, MetaEstimatorMixin):
282281
- An iterable yielding train/test splits.
283282
284283
For integer/None inputs, if ``y`` is binary or multiclass,
285-
:class:`StratifiedKFold` used. If the estimator is a classifier
284+
:class:`StratifiedKFold` used. If the estimator is a classifier
286285
or if ``y`` is neither binary nor multiclass, :class:`KFold` is used.
287286
288287
Refer :ref:`User Guide <cross_validation>` for the various

0 commit comments

Comments
 (0)