Skip to content

Commit

Permalink
correct dim for 1 archetype case
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzcl committed Dec 22, 2024
1 parent 1fecf52 commit 91a6b7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion archetypes/numpy/_aa.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def fit_transform(self, X, y=None):

if self.n_archetypes == 1:
n_samples = X.shape[0]
archetypes_ = np.mean(X, axis=0)
archetypes_ = np.mean(X, axis=0, keepdims=True)
B_ = np.full((self.n_archetypes, n_samples), 1 / n_samples, dtype=X.dtype)
A_ = np.ones((n_samples, self.n_archetypes), dtype=X.dtype)
best_rss = squared_norm(X - archetypes_)
Expand Down

0 comments on commit 91a6b7f

Please sign in to comment.