From 3f3947ca2aa94f0d663679a73e03ec35698b6012 Mon Sep 17 00:00:00 2001 From: erdogant Date: Tue, 17 Dec 2024 15:00:05 +0100 Subject: [PATCH] pytest updates --- pca/examples.py | 4 ++-- pca/tests/test_pca.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pca/examples.py b/pca/examples.py index cb41c04..395254e 100644 --- a/pca/examples.py +++ b/pca/examples.py @@ -10,7 +10,7 @@ # Fit transform results = model.fit_transform(df) -model.biplot(s=15, fontsize=0) +model.biplot(s=20, fontsize=0, labels=None) # %% issue 54 # https://github.com/erdogant/pca/issues/54 @@ -216,7 +216,7 @@ # All available markers markers = np.array(['.', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X']) # Create colors -cmap = plt.cm.get_cmap('tab20c', len(markers)) +cmap = plt.get_cmap('tab20c', len(markers)) # Generate random integers random_integers = np.random.randint(0, len(markers), size=X.shape[0]) # Draw markers diff --git a/pca/tests/test_pca.py b/pca/tests/test_pca.py index 9e42388..47b0d41 100644 --- a/pca/tests/test_pca.py +++ b/pca/tests/test_pca.py @@ -42,7 +42,7 @@ def test_specifying(self): combinations=list(combinations) # Init - model = pca(verbose=0) + model = pca(verbose=None) # Fit model.fit_transform(X) # Make plot with blue arrows and text @@ -215,7 +215,7 @@ def test_correct_ordering_features_in_biplot(self): def test_for_new_outliers_after_transformation(self): # Generate dataset np.random.seed(42) - n_total = 10000 + n_total = 1000 train_ratio = 0.8 n_features = 10 my_array = np.random.randint(low=1, high=10, size=(n_total, n_features)) @@ -231,7 +231,7 @@ def test_for_new_outliers_after_transformation(self): # Inference: mapping of data into space. PC_test = model.transform(X=X_test[features]) # Compute new outliers - scores, _ = model.compute_outliers(PC=PC_test, n_std=3, verbose=3) + scores, _ = model.compute_outliers(PC=PC_test, n_std=3, verbose=3) assert model.results.get('outliers_params', None) is not None assert scores.shape[0]==X_test.shape[0]