Skip to content

Commit

Permalink
pytest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Dec 17, 2024
1 parent 375a415 commit 3f3947c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pca/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pca/tests/test_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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]
Expand Down

0 comments on commit 3f3947c

Please sign in to comment.