Skip to content

Commit

Permalink
Merge pull request #83 from mathematicalmichael/feature/unit-dimension
Browse files Browse the repository at this point in the history
fix: prototype support for `n_components=1`
  • Loading branch information
hyhuang00 authored Dec 6, 2024
2 parents 877be41 + 73ee1d9 commit b44a01f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/pacmap/pacmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,12 @@ def __init__(self,
self.random_state = 0
_RANDOM_STATE = None # Reset random state

if self.n_components < 2:
if self.n_components < 1:
raise ValueError(
"The number of projection dimensions must be at least 2.")
"The number of projection dimensions must be at least 1."
)
if self.n_components != 2:
logger.warning("Note: `n_components != 2` have not been thoroughly tested.")
if self.lr <= 0:
raise ValueError("The learning rate must be larger than 0.")
if self.distance == "hamming" and apply_pca:
Expand Down

0 comments on commit b44a01f

Please sign in to comment.