Skip to content

Commit

Permalink
Rename PCA to PrincipalComponentAnalysis (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn authored May 8, 2024
1 parent bc9a4d1 commit 5779a2d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions include/tapkee/defines/methods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down
4 changes: 2 additions & 2 deletions include/tapkee/methods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class DynamicImplementation : public ImplementationBase<RandomAccessIterator, Ke
tapkee_method_handle(HessianLocallyLinearEmbedding);
tapkee_method_handle(LaplacianEigenmaps);
tapkee_method_handle(LocalityPreservingProjections);
tapkee_method_handle(PCA);
tapkee_method_handle(KernelPCA);
tapkee_method_handle(PrincipalComponentAnalysis);
tapkee_method_handle(KernelPrincipalComponentAnalysis);
tapkee_method_handle(RandomProjection);
tapkee_method_handle(StochasticProximityEmbedding);
tapkee_method_handle(PassThru);
Expand Down
2 changes: 1 addition & 1 deletion include/tapkee/methods/kernel_pca.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace tapkee
namespace tapkee_internal
{

__TAPKEE_IMPLEMENTATION(KernelPCA)
__TAPKEE_IMPLEMENTATION(KernelPrincipalComponentAnalysis)
TapkeeOutput embed()
{
DenseSymmetricMatrix centered_kernel_matrix = compute_centered_kernel_matrix(this->begin, this->end, this->kernel);
Expand Down
2 changes: 1 addition & 1 deletion include/tapkee/methods/pca.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
8 changes: 4 additions & 4 deletions test/unit/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()));
Expand All @@ -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()));

Expand Down
8 changes: 4 additions & 4 deletions test/unit/methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/projecting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5779a2d

Please sign in to comment.