pmlpp/mlpp/pca/pca.h

32 lines
532 B
C++

#ifndef MLPP_PCA_H
#define MLPP_PCA_H
//
// PCA.hpp
//
// Created by Marc Melikyan on 10/2/20.
//
#include "core/math/math_defs.h"
#include <vector>
class MLPPPCA {
public:
MLPPPCA(std::vector<std::vector<real_t>> inputSet, int k);
std::vector<std::vector<real_t>> principalComponents();
real_t score();
private:
std::vector<std::vector<real_t>> inputSet;
std::vector<std::vector<real_t>> X_normalized;
std::vector<std::vector<real_t>> U_reduce;
std::vector<std::vector<real_t>> Z;
int k;
};
#endif /* PCA_hpp */