63 <<
"Input metadata file: " <<
fnIn << std::endl
64 <<
"Output metadata: " <<
fnOut << std::endl
65 <<
"Output mapping: " <<
fnMapping << std::endl
67 <<
"Dimension out: " <<
outputDim << std::endl
71 std::cout <<
"k=" <<
kNN << std::endl;
73 std::cout <<
"sigma=" <<
sigma << std::endl;
75 std::cout <<
"t=" <<
t << std::endl;
77 std::cout <<
"Niter=" <<
Niter << std::endl;
79 std::cout <<
"Global=" <<
global << std::endl;
87 addParamsLine(
" [-m <dimRefMethod=PCA>]: Dimensionality Reduction method selected");
90 addParamsLine(
" LTSA <k=12> : Local Tangent Space Alignment, k=number of nearest neighbours");
91 addParamsLine(
" DM <s=1> <t=1> : Diffusion map, t=Markov random walk, s=kernel sigma");
92 addParamsLine(
" LLTSA <k=12> : Linear Local Tangent Space Alignment, k=number of nearest neighbours");
93 addParamsLine(
" LPP <k=12> <s=1> : Linearity Preserving Projection, k=number of nearest neighbours, s=kernel sigma");
95 addParamsLine(
" pPCA <n=200> : Probabilistic PCA, n=number of iterations");
96 addParamsLine(
" LE <k=7> <s=1> : Laplacian Eigenmap, k=number of nearest neighbours, s=kernel sigma");
97 addParamsLine(
" HLLE <k=12> : Hessian Locally Linear Embedding, k=number of nearest neighbours");
98 addParamsLine(
" SPE <k=12> <global=1> : Stochastic Proximity Embedding, k=number of nearest neighbours, global embedding or not");
99 addParamsLine(
" NPE <k=12> : Neighborhood Preserving Embedding, k=number of nearest neighbours");
100 addParamsLine(
" [--dout <d=2> <method=CorrDim>] : Output dimension. Set to -1 for automatic estimation with a specific method");
104 addParamsLine(
" [--saveMapping <fn=\"\">] : Save mapping if available (PCA, LLTSA, LPP, pPCA, NPE) so that it can be reused later (Y=X*M) (use the flag --more for details)");
105 addParamsLine(
" :+Y is the output matrix with individuals as rows, M is the mapping matrix");
106 addParamsLine(
" :+X is the input matrix with individuals as rows, with the mean subtracted from the columns");
108 addParamsLine(
" :+ from numpy import loadtxt, mean, outer, ones");
110 addParamsLine(
" :+ X = X_original - outer(ones(X_original.shape[0]),mean(X_original, axis=0))");
170 std::cout <<
"Estimated dimensionality: " <<
outputDim << std::endl;
182 throw std::invalid_argument(
"Error, output dimension should be smaller or equal to input dimension");
192 <<
"Dimension in: " << inputDim << std::endl
193 <<
"Number of samples: " << Nsamples << std::endl
200 addUsageLine(
"This program takes an input matrix, whose rows are individual observations and ");
201 addUsageLine(
"projects each sample onto a lower dimensional space using the selected method. Note: ");
202 addUsageLine(
"that each observation component in a row should be separated by white spaces.");
207 addParamsLine(
" --samples <N> : Number of observations in the input matrix");
208 addExampleLine(
"xmipp_matrix_dimred -i matrixIn.txt -o matrixOut.txt --din 30 --dout 2 --samples 1000");
DiffusionMaps algorithmDiffusionMaps
virtual void produceSideInfo()
Produce side info.
ProgDimRed()
Empty constructor.
void readParams()
Read argument from command line.
double getDoubleParam(const char *param, int arg=0)
#define REPORT_ERROR(nerr, ErrormMsg)
void setInputData(Matrix2D< double > &X)
Set input data.
void setSpecificParameters(size_t Niters=200)
Set specific parameters.
void setDefaultComment(const char *param, const char *comment)
KernelPCA algorithmKernelPCA
void processDefaultComment(const char *param, const char *left)
const Matrix2D< double > & getReducedData()
Get reduced data.
DimRedAlgorithm * algorithm
void resizeNoCopy(int Ydim, int Xdim)
void setSpecificParameters(double sigma=1.0)
Set specific parameters.
void setSpecificParameters(int k=12)
Set specific parameters.
void setSpecificParameters(int kNeighbours=12)
Set specific parameters.
const char * getParam(const char *param, int arg=0)
virtual void reduceDimensionality()=0
Reduce dimensionality.
Error related to numerical calculation.
void addExampleLine(const char *example, bool verbatim=true)
virtual void readParams()
Read argument from command line.
void produceSideInfo()
Produce side info.
int verbose
Verbosity level.
void estimateDimension()
Estimate dimensionality.
LaplacianEigenmap algorithmLaplacianEigenmap
void defineParams()
Define parameters.
virtual void defineParams()
Define parameters.
ProbabilisticPCA algorithmProbabilisticPCA
void setSpecificParameters(double sigma=1.0, size_t numberOfNeighbours=7)
Set specific parameters.
DimRedDistance2 distance
Distance function.
void setSpecificParameters(int k=12, double sigma=1.)
Set specific parameters.
FileName fnMapping
Save mapping.
void read(const FileName &fn)
void write(const FileName &fn) const
void setOutputDimensionality(size_t outputDim)
Set output dimensionality.
void addUsageLine(const char *line, bool verbatim=false)
void setSpecificParameters(bool global=true, int k=12)
Set specific parameters.
void setSpecificParameters(int k=12)
Set specific parameters.
int getIntParam(const char *param, int arg=0)
void setSpecificParameters(double t=1.0, double sigma=1.0)
Set specific parameters.
void addParamsLine(const String &line)
HessianLLE algorithmHessianLLE