Skip to content

Commit

Permalink
tests: change data set loading according to deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andreArtelt committed Aug 4, 2020
1 parent e2502a2 commit f56a2ee
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/sklearn/test_sklearn_decisiontree.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_plausible_counterfactual():

def test_decisiontree_classifier():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -124,7 +124,7 @@ def test_decisiontree_classifier():

def test_decisiontree_regressor():
# Load data
X, y = load_boston(True)
X, y = load_boston(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down
4 changes: 2 additions & 2 deletions tests/sklearn/test_sklearn_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

def test_knn_classifier():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -70,7 +70,7 @@ def test_knn_classifier():

def test_knn_regressor():
# Load data
X, y = load_boston(True)
X, y = load_boston(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down
2 changes: 1 addition & 1 deletion tests/sklearn/test_sklearn_lda.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def test_lda():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down
2 changes: 1 addition & 1 deletion tests/sklearn/test_sklearn_linearregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def test_linearregression():
# Load data
X, y = load_boston(True)
X, y = load_boston(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down
8 changes: 4 additions & 4 deletions tests/sklearn/test_sklearn_lvq.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def test_glvq():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -90,7 +90,7 @@ def test_glvq():

def test_gmlvq():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -160,7 +160,7 @@ def test_gmlvq():

def test_lgmlvq():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -230,7 +230,7 @@ def test_lgmlvq():

def test_lgmlvq_classwise():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down
4 changes: 2 additions & 2 deletions tests/sklearn/test_sklearn_naivebayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def test_gaussiannaivebayes():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -91,7 +91,7 @@ def test_gaussiannaivebayes():
assert all([True if i in features_whitelist else delta[i] == 0. for i in range(x_orig.shape[0])])

# Test binary case
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)
idx = y != 2
X, y = X[idx, :], y[idx]

Expand Down
4 changes: 2 additions & 2 deletions tests/sklearn/test_sklearn_qda.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def test_qda():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -90,7 +90,7 @@ def test_qda():
assert all([True if i in features_whitelist else delta[i] == 0. for i in range(x_orig.shape[0])])

# Test binary case
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)
idx = y != 2
X, y = X[idx, :], y[idx]

Expand Down
4 changes: 2 additions & 2 deletions tests/sklearn/test_sklearn_randomforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

def test_randomforest_classifier():
# Load data
X, y = load_iris(True)
X, y = load_iris(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down Expand Up @@ -52,7 +52,7 @@ def test_randomforest_classifier():

def test_randomforest_regressor():
# Load data
X, y = load_boston(True)
X, y = load_boston(return_X_y=True)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=4242)

Expand Down

0 comments on commit f56a2ee

Please sign in to comment.