From 42a630b2aa6f0b35f7ad5d1fba9ab24f6d644ae6 Mon Sep 17 00:00:00 2001 From: Michael Pilosov <40366263+mathematicalmichael@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:32:57 -0700 Subject: [PATCH 1/3] Update pacmap.py --- source/pacmap/pacmap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/pacmap/pacmap.py b/source/pacmap/pacmap.py index 02b504c..20daf26 100644 --- a/source/pacmap/pacmap.py +++ b/source/pacmap/pacmap.py @@ -869,9 +869,11 @@ 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.") + if self.n_components == 1: + logger.warning('Warning: Defaults were chosen around dimension 2. Dimension 1 has not been tested.') if self.lr <= 0: raise ValueError("The learning rate must be larger than 0.") if self.distance == "hamming" and apply_pca: From 18bb8adb8a0d070a057612ca2ab24f173c5f3493 Mon Sep 17 00:00:00 2001 From: Michael Pilosov <40366263+mathematicalmichael@users.noreply.github.com> Date: Tue, 26 Nov 2024 04:50:38 +0000 Subject: [PATCH 2/3] address comments --- source/pacmap/pacmap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/pacmap/pacmap.py b/source/pacmap/pacmap.py index 20daf26..0b4ddeb 100644 --- a/source/pacmap/pacmap.py +++ b/source/pacmap/pacmap.py @@ -871,9 +871,10 @@ def __init__(self, if self.n_components < 1: raise ValueError( - "The number of projection dimensions must be at least 2.") - if self.n_components == 1: - logger.warning('Warning: Defaults were chosen around dimension 2. Dimension 1 has not been tested.') + "The number of projection dimensions must be at least 1." + ) + if self.n_components != 2: + logger.debug("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: From 73ee1d9f435e677bdd178df0df771e054971b89c Mon Sep 17 00:00:00 2001 From: Michael Pilosov <40366263+mathematicalmichael@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:59:18 -0700 Subject: [PATCH 3/3] debug -> warning going back to warning, may revisit logging levels in the future as a separate PR --- source/pacmap/pacmap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/pacmap/pacmap.py b/source/pacmap/pacmap.py index 0b4ddeb..bb4219f 100644 --- a/source/pacmap/pacmap.py +++ b/source/pacmap/pacmap.py @@ -874,7 +874,7 @@ def __init__(self, "The number of projection dimensions must be at least 1." ) if self.n_components != 2: - logger.debug("Note: `n_components != 2` have not been thoroughly tested.") + 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: