From 5779a2dd5dfe43c70f006bd0be67ea2bbad2a15a Mon Sep 17 00:00:00 2001 From: Sergey Lisitsyn Date: Wed, 8 May 2024 09:11:24 +0100 Subject: [PATCH] Rename PCA to PrincipalComponentAnalysis (#96) --- include/tapkee/defines/methods.hpp | 4 ++-- include/tapkee/methods.hpp | 4 ++-- include/tapkee/methods/kernel_pca.hpp | 2 +- include/tapkee/methods/pca.hpp | 2 +- src/cli/util.hpp | 4 ++-- test/unit/interface.cpp | 8 ++++---- test/unit/methods.cpp | 8 ++++---- test/unit/projecting.cpp | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/tapkee/defines/methods.hpp b/include/tapkee/defines/methods.hpp index 1d24404..12cf419 100644 --- a/include/tapkee/defines/methods.hpp +++ b/include/tapkee/defines/methods.hpp @@ -123,10 +123,10 @@ static const DimensionReductionMethod StochasticProximityEmbedding("Stochastic P /** Kernel PCA as described in * @cite Scholkopf1997 */ -static const DimensionReductionMethod KernelPCA("Kernel Principal Component Analysis (KPCA)", RequiresKernel); +static const DimensionReductionMethod KernelPrincipalComponentAnalysis("Kernel Principal Component Analysis (KPCA)", RequiresKernel); /** Principal Component Analysis */ -static const DimensionReductionMethod PCA("Principal Component Analysis (PCA)", RequiresFeatures); +static const DimensionReductionMethod PrincipalComponentAnalysis("Principal Component Analysis (PCA)", RequiresFeatures); /** Random Projection as described in * @cite Kaski1998*/ diff --git a/include/tapkee/methods.hpp b/include/tapkee/methods.hpp index 4d2cd93..d849853 100644 --- a/include/tapkee/methods.hpp +++ b/include/tapkee/methods.hpp @@ -62,8 +62,8 @@ class DynamicImplementation : public ImplementationBasebegin, this->end, this->kernel); diff --git a/include/tapkee/methods/pca.hpp b/include/tapkee/methods/pca.hpp index 06c7138..c8117b6 100644 --- a/include/tapkee/methods/pca.hpp +++ b/include/tapkee/methods/pca.hpp @@ -15,7 +15,7 @@ namespace tapkee namespace tapkee_internal { -__TAPKEE_IMPLEMENTATION(PCA) +__TAPKEE_IMPLEMENTATION(PrincipalComponentAnalysis) TapkeeOutput embed() { DenseVector mean_vector = compute_mean(this->begin, this->end, this->features, this->current_dimension); diff --git a/src/cli/util.hpp b/src/cli/util.hpp index 43e70d1..5a5531f 100644 --- a/src/cli/util.hpp +++ b/src/cli/util.hpp @@ -114,9 +114,9 @@ tapkee::DimensionReductionMethod parse_reduction_method(const char* str) if (!strcmp(str, "diffusion_map") || !strcmp(str, "dm")) return tapkee::DiffusionMap; if (!strcmp(str, "kernel_pca") || !strcmp(str, "kpca")) - return tapkee::KernelPCA; + return tapkee::KernelPrincipalComponentAnalysis; if (!strcmp(str, "pca")) - return tapkee::PCA; + return tapkee::PrincipalComponentAnalysis; if (!strcmp(str, "random_projection") || !strcmp(str, "ra")) return tapkee::RandomProjection; if (!strcmp(str, "laplacian_eigenmaps") || !strcmp(str, "la")) diff --git a/test/unit/interface.cpp b/test/unit/interface.cpp index 0cbf180..d63acba 100644 --- a/test/unit/interface.cpp +++ b/test/unit/interface.cpp @@ -35,7 +35,7 @@ TEST(Interface, ChainInterfaceOrder) .embedRange(indices.begin(), indices.end())); ASSERT_NO_THROW(output = tapkee::initialize() - .withParameters((method = KernelPCA)) + .withParameters((method = KernelPrincipalComponentAnalysis)) .withDistance(dcb) .withKernel(kcb) .withFeatures(fcb) @@ -75,13 +75,13 @@ TEST(Interface, ChainInterfaceOrder) .embedRange(indices.begin(), indices.end())); ASSERT_NO_THROW(output = tapkee::initialize() - .withParameters((method = KernelPCA)) + .withParameters((method = KernelPrincipalComponentAnalysis)) .withKernel(kcb) .withDistance(dcb) .embedRange(indices.begin(), indices.end())); ASSERT_NO_THROW(output = tapkee::initialize() - .withParameters((method = KernelPCA)) + .withParameters((method = KernelPrincipalComponentAnalysis)) .withKernel(kcb) .withFeatures(fcb) .embedRange(indices.begin(), indices.end())); @@ -99,7 +99,7 @@ TEST(Interface, ChainInterfaceOrder) .embedRange(indices.begin(), indices.end())); ASSERT_NO_THROW(output = tapkee::initialize() - .withParameters((method = KernelPCA)) + .withParameters((method = KernelPrincipalComponentAnalysis)) .withKernel(kcb) .embedRange(indices.begin(), indices.end())); diff --git a/test/unit/methods.cpp b/test/unit/methods.cpp index a7e5af2..2a5b953 100644 --- a/test/unit/methods.cpp +++ b/test/unit/methods.cpp @@ -96,14 +96,14 @@ TEST(Methods, StochasticProximityEmbeddingSmokeTest) smoketest(StochasticProximityEmbedding); } -TEST(Methods, KernelPCASmokeTest) +TEST(Methods, KernelPrincipalComponentAnalysisSmokeTest) { - smoketest(KernelPCA); + smoketest(KernelPrincipalComponentAnalysis); } -TEST(Methods, PCASmokeTest) +TEST(Methods, PrincipalComponentAnalysisSmokeTest) { - smoketest(PCA); + smoketest(PrincipalComponentAnalysis); } TEST(Methods, RandomProjectionSmokeTest) diff --git a/test/unit/projecting.cpp b/test/unit/projecting.cpp index 74a1219..1cddcf5 100644 --- a/test/unit/projecting.cpp +++ b/test/unit/projecting.cpp @@ -6,14 +6,14 @@ using namespace tapkee; -TEST(Projecting, PCA) +TEST(Projecting, PrincipalComponentAnalysis) { const int N = 50; DenseMatrix X = swissroll(N); TapkeeOutput output; - ASSERT_NO_THROW(output = tapkee::initialize().withParameters((method = PCA, target_dimension = 2)).embedUsing(X)); + ASSERT_NO_THROW(output = tapkee::initialize().withParameters((method = PrincipalComponentAnalysis, target_dimension = 2)).embedUsing(X)); auto projected = output.projection(X.col(0)); ASSERT_EQ(2, projected.size());