diff --git a/tests/baseline_images/test_classifier/test_prcurve/test_binary_decision.png b/tests/baseline_images/test_classifier/test_prcurve/test_binary_decision.png index b15eed061..8ce4607d6 100644 Binary files a/tests/baseline_images/test_classifier/test_prcurve/test_binary_decision.png and b/tests/baseline_images/test_classifier/test_prcurve/test_binary_decision.png differ diff --git a/tests/baseline_images/test_cluster/test_elbow/test_locate_elbow.png b/tests/baseline_images/test_cluster/test_elbow/test_locate_elbow.png index f11ddd5c0..1410ddb6a 100644 Binary files a/tests/baseline_images/test_cluster/test_elbow/test_locate_elbow.png and b/tests/baseline_images/test_cluster/test_elbow/test_locate_elbow.png differ diff --git a/tests/test_classifier/test_class_prediction_error.py b/tests/test_classifier/test_class_prediction_error.py index bbd8bf637..83dd40631 100644 --- a/tests/test_classifier/test_class_prediction_error.py +++ b/tests/test_classifier/test_class_prediction_error.py @@ -26,7 +26,7 @@ from yellowbrick.datasets import load_occupancy from yellowbrick.classifier.class_prediction_error import * -from sklearn.svm import LinearSVC +from sklearn.svm import LinearSVC, SVC from sklearn.ensemble import RandomForestClassifier from sklearn.datasets import make_multilabel_classification from sklearn.model_selection import train_test_split as tts @@ -60,7 +60,7 @@ def test_numpy_integration(self): classes = ["unoccupied", "occupied"] - model = LinearSVC(random_state=42) + model = SVC(random_state=42) model.fit(X, y) visualizer = ClassPredictionError(model, classes=classes) visualizer.score(X, y) @@ -79,7 +79,7 @@ def test_pandas_integration(self): X, y = load_occupancy(return_dataset=True).to_pandas() classes = ["unoccupied", "occupied"] - model = LinearSVC(random_state=42) + model = SVC(random_state=42) model.fit(X, y) visualizer = ClassPredictionError(model, classes=classes) visualizer.score(X, y) @@ -98,7 +98,7 @@ def test_class_prediction_error_quickmethod(self): fig = plt.figure() ax = fig.add_subplot() - clf = LinearSVC(random_state=42) + clf = SVC(random_state=42) viz = class_prediction_error(clf, X, y, ax=ax, show=False) # Not sure why the tolerance must be so high for this @@ -112,32 +112,44 @@ def test_class_prediction_error_quickmethod_X_test_only(self): Test the ClassPredictionError quickmethod """ X, y = load_occupancy(return_dataset=True).to_numpy() - X_train, X_test, y_train, y_test = tts(X, y, test_size=0.2, shuffle=True, - random_state=42) + X_train, X_test, y_train, y_test = tts( + X, y, test_size=0.2, shuffle=True, random_state=42 + ) fig = plt.figure() ax = fig.add_subplot() clf = LinearSVC(random_state=42) - with pytest.raises(YellowbrickValueError, - match="must specify both X_test and y_test or neither"): - class_prediction_error(clf, X_train=X_train, y_train=y_train, - X_test=X_test, ax=ax, show=False) + with pytest.raises( + YellowbrickValueError, + match="must specify both X_test and y_test or neither", + ): + class_prediction_error( + clf, X_train=X_train, y_train=y_train, X_test=X_test, ax=ax, show=False + ) def test_class_prediction_error_quickmethod_X_test_and_y_test(self): """ Test the ClassPredictionError quickmethod """ X, y = load_occupancy(return_dataset=True).to_numpy() - X_train, X_test, y_train, y_test = tts(X, y, test_size=0.2, shuffle=True, - random_state=42) + X_train, X_test, y_train, y_test = tts( + X, y, test_size=0.2, shuffle=True, random_state=42 + ) fig = plt.figure() ax = fig.add_subplot() - clf = LinearSVC(random_state=42) - viz = class_prediction_error(clf, X_train=X_train, y_train=y_train, - X_test=X_test, y_test=y_test, ax=ax, show=False) + clf = SVC(random_state=42) + viz = class_prediction_error( + clf, + X_train=X_train, + y_train=y_train, + X_test=X_test, + y_test=y_test, + ax=ax, + show=False, + ) # Not sure why the tolerance must be so high for this # Failing on travis with RMS 9.544 diff --git a/tests/test_cluster/test_elbow.py b/tests/test_cluster/test_elbow.py index e5a0e6672..7885ccb5e 100644 --- a/tests/test_cluster/test_elbow.py +++ b/tests/test_cluster/test_elbow.py @@ -328,7 +328,7 @@ def test_locate_elbow(self): visualizer.fit(X) assert len(visualizer.k_scores_) == 5 assert visualizer.elbow_value_ == 3 - expected = np.array([4286.5, 12463.4, 8763.8, 6939.3, 5858.8]) + expected = np.array([4286.5, 12463.4, 8763.3, 6938.2, 5858.4]) visualizer.finalize() self.assert_images_similar(visualizer, tol=0.5, windows_tol=2.2)