|
7 | 7 | from scipy import stats |
8 | 8 |
|
9 | 9 | from sklearn.utils.testing import assert_true |
10 | | -from sklearn.utils.testing import assert_false |
11 | 10 | from sklearn.utils.testing import assert_equal |
12 | 11 | from sklearn.utils.testing import assert_almost_equal |
13 | 12 | from sklearn.utils.testing import assert_raises |
@@ -896,26 +895,6 @@ def test_shufflesplit_reproducible(): |
896 | 895 | assert_array_equal(list(a for a, b in ss), list(a for a, b in ss)) |
897 | 896 |
|
898 | 897 |
|
899 | | -def test_safe_split_with_precomputed_kernel(): |
900 | | - clf = SVC() |
901 | | - clfp = SVC(kernel="precomputed") |
902 | | - |
903 | | - iris = load_iris() |
904 | | - X, y = iris.data, iris.target |
905 | | - K = np.dot(X, X.T) |
906 | | - |
907 | | - cv = cval.ShuffleSplit(X.shape[0], test_size=0.25, random_state=0) |
908 | | - tr, te = list(cv)[0] |
909 | | - |
910 | | - X_tr, y_tr = cval._safe_split(clf, X, y, tr) |
911 | | - K_tr, y_tr2 = cval._safe_split(clfp, K, y, tr) |
912 | | - assert_array_almost_equal(K_tr, np.dot(X_tr, X_tr.T)) |
913 | | - |
914 | | - X_te, y_te = cval._safe_split(clf, X, y, te, tr) |
915 | | - K_te, y_te2 = cval._safe_split(clfp, K, y, te, tr) |
916 | | - assert_array_almost_equal(K_te, np.dot(X_te, X_tr.T)) |
917 | | - |
918 | | - |
919 | 898 | def test_cross_val_score_allow_nans(): |
920 | 899 | # Check that cross_val_score allows input data with NaNs |
921 | 900 | X = np.arange(200, dtype=np.float64).reshape(10, -1) |
@@ -1092,12 +1071,3 @@ def test_sparse_fit_params(): |
1092 | 1071 | fit_params = {'sparse_sample_weight': coo_matrix(np.eye(X.shape[0]))} |
1093 | 1072 | a = cval.cross_val_score(clf, X, y, fit_params=fit_params) |
1094 | 1073 | assert_array_equal(a, np.ones(3)) |
1095 | | - |
1096 | | - |
1097 | | -def test_check_is_partition(): |
1098 | | - p = np.arange(100) |
1099 | | - assert_true(cval._check_is_partition(p, 100)) |
1100 | | - assert_false(cval._check_is_partition(np.delete(p, 23), 100)) |
1101 | | - |
1102 | | - p[0] = 23 |
1103 | | - assert_false(cval._check_is_partition(p, 100)) |
0 commit comments