e74e03294af942a6c82a7b482f517567e330dee5,sklearn/tree/tests/test_tree.py,,test_max_features,#,425
Before Change
assert_raises(ValueError, est.fit, X, y)
est = TreeEstimator(max_features=1.5)
assert_raises(ValueError, est.fit, X, y)
est = TreeEstimator(max_features="foobar")
assert_raises(ValueError, est.fit, X, y)
After Change
// use values of max_features that are invalid
est = TreeEstimator(max_features=10)
with pytest.raises(ValueError):
est.fit(X, y)
est = TreeEstimator(max_features=-1)
with pytest.raises(ValueError):
est.fit(X, y)
est = TreeEstimator(max_features=0.0)
with pytest.raises(ValueError):
est.fit(X, y)
est = TreeEstimator(max_features=1.5)
with pytest.raises(ValueError):
est.fit(X, y)
est = TreeEstimator(max_features="foobar")
with pytest.raises(ValueError):
est.fit(X, y)
def test_error():
// Test that it gives proper exception on deficient input.
for name, TreeEstimator in CLF_TREES.items():
// predict before fit
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 14
Instances
Project Name: scikit-learn/scikit-learn
Commit Name: e74e03294af942a6c82a7b482f517567e330dee5
Time: 2019-08-28
Author: 43701530+sameshl@users.noreply.github.com
File Name: sklearn/tree/tests/test_tree.py
Class Name:
Method Name: test_max_features
Project Name: scikit-learn/scikit-learn
Commit Name: e74e03294af942a6c82a7b482f517567e330dee5
Time: 2019-08-28
Author: 43701530+sameshl@users.noreply.github.com
File Name: sklearn/tree/tests/test_tree.py
Class Name:
Method Name: check_class_weight_errors
Project Name: scikit-learn/scikit-learn
Commit Name: e74e03294af942a6c82a7b482f517567e330dee5
Time: 2019-08-28
Author: 43701530+sameshl@users.noreply.github.com
File Name: sklearn/tree/tests/test_tree.py
Class Name:
Method Name: test_max_features
Project Name: scikit-learn/scikit-learn
Commit Name: e74e03294af942a6c82a7b482f517567e330dee5
Time: 2019-08-28
Author: 43701530+sameshl@users.noreply.github.com
File Name: sklearn/tree/tests/test_tree.py
Class Name:
Method Name: test_sample_weight_invalid
Project Name: scikit-learn/scikit-learn
Commit Name: e230778f6f1f24de1aa694b52fa9411a1e5c3197
Time: 2021-02-07
Author: 41724425+icky254@users.noreply.github.com
File Name: sklearn/tests/test_dummy.py
Class Name:
Method Name: test_quantile_invalid
Project Name: lmcinnes/umap
Commit Name: e45ce5f127a491192f340818c7c39f98af8d5156
Time: 2021-02-09
Author: valerio.maggio@gmail.com
File Name: umap/tests/test_umap_validation_params.py
Class Name:
Method Name: test_umap_bad_metrics