pmlpp/mlpp/pca/pca.h

32 lines
532 B
C
Raw Normal View History

2023-01-24 18:57:18 +01:00
#ifndef MLPP_PCA_H
#define MLPP_PCA_H
//
// PCA.hpp
//
// Created by Marc Melikyan on 10/2/20.
//
2023-01-27 13:01:16 +01:00
#include "core/math/math_defs.h"
#include <vector>
2023-01-24 19:20:18 +01:00
2023-01-25 00:54:50 +01:00
class MLPPPCA {
2023-01-24 19:00:54 +01:00
public:
2023-01-27 13:01:16 +01:00
MLPPPCA(std::vector<std::vector<real_t>> inputSet, int k);
std::vector<std::vector<real_t>> principalComponents();
real_t score();
2023-01-24 19:00:54 +01:00
private:
2023-01-27 13:01:16 +01:00
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;
2023-01-24 19:00:54 +01:00
int k;
};
2023-01-24 19:20:18 +01:00
#endif /* PCA_hpp */