Computes the PCA and transform a vector. More...
#include <pcatransformer.h>
Public Member Functions | |
PCATransformer (bool debug=false) | |
Default constructor. | |
void | computePCA (Corpus *corpus) |
Computes the PCA from a corpus. | |
bool | load (string filename) |
Load a previously computed PCA. | |
bool | save (string filename) |
Save the computed PCA. | |
vector< float > | transform (vector< float > input) |
Transform a vector in the new coordinates. | |
Corpus * | transform (const Corpus &corpus, int coord=2) |
Transform a corpus to a new one (keeping only the 'coord' first coordinates). The returned corpus has to be deleted by the user. |
Static Public Member Functions | |
static string | serializeMatrix (MatrixXf m) |
Serialize a matrix : write it down as a human-readable string. | |
static MatrixXf | readMatrix (string m, int nbRows=1, int nbCols=1) |
Read back a matrix : create it from a human-readable string. |
Computes the PCA and transform a vector.
|
static |
Read back a matrix : create it from a human-readable string.
Read a matrix back : create it from a human-readable string.