Xmipp
v3.23.11-Nereus
|
Classes | |
class | GenerateData |
class | DimRedAlgorithm |
Typedefs | |
typedef double(* | DimRedDistance2) (const Matrix2D< double > &X, size_t i1, size_t i2) |
Enumerations | |
enum | DatasetType { DatasetType::SWISS, DatasetType::HELIX, DatasetType::TWINPEAKS, DatasetType::CLUSTER3D, DatasetType::INTERSECT } |
Functions | |
void | computeDistance (const Matrix2D< double > &X, Matrix2D< double > &distance, DimRedDistance2 f=NULL, bool computeSqrt=true) |
void | computeRandomPointsDistance (const Matrix2D< double > &X, Matrix1D< double > &distance, Matrix1D< int > ind1, Matrix1D< int > ind2, DimRedDistance2 f, bool computeSqrt) |
void | computeDistanceToNeighbours (const Matrix2D< double > &X, int K, Matrix2D< double > &distance, DimRedDistance2 f=NULL, bool computeSqrt=true) |
void | computeSimilarityMatrix (Matrix2D< double > &D2, double sigma, bool skipZeros=false, bool normalize=false) |
void | computeGraphLaplacian (const Matrix2D< double > &G, Matrix2D< double > &L) |
double | intrinsicDimensionality (Matrix2D< double > &X, const String &method="MLE", bool normalize=true, DimRedDistance2 f=NULL) |
void | kNearestNeighbours (const Matrix2D< double > &X, int K, Matrix2D< int > &idx, Matrix2D< double > &distance, DimRedDistance2 f=NULL, bool computeSqrt=true) |
void | extractNearestNeighbours (const Matrix2D< double > &X, Matrix2D< int > &idx, int i, Matrix2D< double > &Xi) |
typedef double(* DimRedDistance2) (const Matrix2D< double > &X, size_t i1, size_t i2) |
Function type to compute the squared distance between individuals i1 and i2 of X
Definition at line 75 of file dimred_tools.h.
|
strong |
Generate test data. Translated from drtools/generate_data.m http://homepage.tudelft.nl/19j49/Matlab_Toolbox_for_Dimensionality_Reduction.html
Original code by Laurens van der Maaten, Delft University of Technology
Enumerator | |
---|---|
SWISS | |
HELIX | |
TWINPEAKS | |
CLUSTER3D | |
INTERSECT |
Definition at line 42 of file dimred_tools.h.
void computeDistance | ( | const Matrix2D< double > & | X, |
Matrix2D< double > & | distance, | ||
DimRedDistance2 | f = NULL , |
||
bool | computeSqrt = true |
||
) |
Compute the distance of all vs all elements in a matrix of observations. Each observation is a row of the matrix X.
Definition at line 274 of file dimred_tools.cpp.
void computeDistanceToNeighbours | ( | const Matrix2D< double > & | X, |
int | K, | ||
Matrix2D< double > & | distance, | ||
DimRedDistance2 | f = NULL , |
||
bool | computeSqrt = true |
||
) |
Compute the distance of each observation to its K nearest neighbours. Each observation is a row of the matrix X. If there are N observations, the size of distance is NxN.
Definition at line 297 of file dimred_tools.cpp.
Compute graph laplacian. L=D-G where D is a diagonal matrix with the row sums of G.
Definition at line 329 of file dimred_tools.cpp.
void computeRandomPointsDistance | ( | const Matrix2D< double > & | X, |
Matrix1D< double > & | distance, | ||
Matrix1D< int > | ind1, | ||
Matrix1D< int > | ind2, | ||
DimRedDistance2 | f, | ||
bool | computeSqrt | ||
) |
Compute the distance of the elements said by the arrays ind1 and ind2
Definition at line 247 of file dimred_tools.cpp.
void computeSimilarityMatrix | ( | Matrix2D< double > & | D2, |
double | sigma, | ||
bool | skipZeros = false , |
||
bool | normalize = false |
||
) |
Compute a similarity matrix from a squared distance matrix. dij=exp(-dij/(2*sigma^2)) The distance matrix can be previously normalized so that the maximum distance is 1
Definition at line 310 of file dimred_tools.cpp.
void extractNearestNeighbours | ( | const Matrix2D< double > & | X, |
Matrix2D< int > & | idx, | ||
int | i, | ||
Matrix2D< double > & | Xi | ||
) |
Extract k-nearest neighbours. This function extracts from the matrix X, the neighbours given by idx for the i-th observation.
Definition at line 450 of file dimred_tools.cpp.
double intrinsicDimensionality | ( | Matrix2D< double > & | X, |
const String & | method = "MLE" , |
||
bool | normalize = true , |
||
DimRedDistance2 | f = NULL |
||
) |
Estimate the intrinsic dimensionality. Performs an estimation of the intrinsic dimensionality of dataset X based on the method specified by method. Possible values for method are 'CorrDim' (based on correlation dimension) and 'MLE' (maximum likelihood estimator). The default method is 'MLE'. All methods are parameterless.
Columns of the input matrix may be normalized to have zero mean and standard deviation 1.
Translated from drtools/intrinsic_dimensionality.m http://homepage.tudelft.nl/19j49/Matlab_Toolbox_for_Dimensionality_Reduction.html
Original code by Laurens van der Maaten, Delft University of Technology
Definition at line 432 of file dimred_tools.cpp.
void kNearestNeighbours | ( | const Matrix2D< double > & | X, |
int | K, | ||
Matrix2D< int > & | idx, | ||
Matrix2D< double > & | distance, | ||
DimRedDistance2 | f = NULL , |
||
bool | computeSqrt = true |
||
) |
k-Nearest neighbours. Given a data matrix (each row is a sample, each column a variable), this function returns a matrix of the indexes of the K nearest neighbours to each one of the input samples sorted by distance. It also returns the corresponding distance.
The element i,j of the output matrices is the index(distance) of the j-th nearest neighbor to the i-th sample.
You can provide a distance function of your own. If not, Euclidean distance is used.
Definition at line 219 of file dimred_tools.cpp.