mirror of
https://github.com/Relintai/pmlpp.git
synced 2024-12-22 15:06:47 +01:00
32 lines
532 B
C++
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 */
|