Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26ef4d0 commit cde9b83Copy full SHA for cde9b83
sklearn/feature_selection/tests/test_from_model.py
@@ -198,3 +198,14 @@ def test_threshold_without_refitting():
198
# Set a higher threshold to filter out more features.
199
model.threshold = "1.0 * mean"
200
assert_greater(X_transform.shape[1], model.transform(data).shape[1])
201
+
202
203
+def test_transform_accepts_infinite_data():
204
+ # Test that transform doesn't check for np.inf and np.nan values.
205
+ est = RandomForestClassifier()
206
+ model = SelectFromModel(estimator=est)
207
+ model.fit(data, y)
208
+ l = len(model.get_support())
209
+ X = np.arange(l).reshape(1, l)
210
+ X.fill(np.inf)
211
+ model.transform(X)
0 commit comments