Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

CLocallyLinearEmbedding Class Reference


Detailed Description

the class LocallyLinearEmbedding used to preprocess data using Locally Linear Embedding algorithm described in

Saul, L. K., Ave, P., Park, F., & Roweis, S. T. (2001). An Introduction to Locally Linear Embedding. Available from, 290(5500), 2323-2326. Retrieved from: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.123.7319&rep=rep1&type=pdf

The process of finding nearest neighbors is parallel and involves Fibonacci Heap and Euclidian distance.

Linear reconstruction step runs in parallel for objects and involves LAPACK routine DPOSV for solving a system of linear equations.

The eigenproblem stated in the algorithm is solved with LAPACK routine DSYEVR or with ARPACK DSAUPD/DSEUPD routines if available.

Due to computation speed, ARPACK is being used with small regularization of weight matrix and Cholesky factorization is used internally for Lanzcos iterations. If the results aren't reasonable LUP factorization could be used with posdef parameter set to false using set_posdef.

Definition at line 50 of file LocallyLinearEmbedding.h.

Inheritance diagram for CLocallyLinearEmbedding:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CLocallyLinearEmbedding ()
virtual ~CLocallyLinearEmbedding ()
virtual bool init (CFeatures *features)
virtual void cleanup ()
virtual SGMatrix< float64_tapply_to_feature_matrix (CFeatures *features)
virtual SGVector< float64_tapply_to_feature_vector (SGVector< float64_t > vector)
void set_k (int32_t k)
int32_t get_k ()
void set_posdef (bool posdef)
bool get_posdef ()
virtual const char * get_name () const
virtual EPreprocessorType get_type () const

Protected Member Functions

void init ()
SGMatrix< float64_tfind_null_space (SGMatrix< float64_t > matrix, int dimension, bool force_lapack)
SGMatrix< int32_t > get_neighborhood_matrix (CDistance *distance)

Static Protected Member Functions

static void * run_neighborhood_thread (void *p)
static void * run_linearreconstruction_thread (void *p)

Protected Attributes

int32_t m_k
bool m_posdef

Constructor & Destructor Documentation

constructor

Definition at line 79 of file LocallyLinearEmbedding.cpp.

~CLocallyLinearEmbedding (  )  [virtual]

destructor

Definition at line 95 of file LocallyLinearEmbedding.cpp.


Member Function Documentation

SGMatrix< float64_t > apply_to_feature_matrix ( CFeatures features  )  [virtual]

apply preprocessor to features

Parameters:
features 

Reimplemented from CDimensionReductionPreprocessor.

Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.

Definition at line 108 of file LocallyLinearEmbedding.cpp.

SGVector< float64_t > apply_to_feature_vector ( SGVector< float64_t vector  )  [virtual]

apply preprocessor to feature vector, not supported for LLE

Parameters:
vector 

Reimplemented from CDimensionReductionPreprocessor.

Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.

Definition at line 234 of file LocallyLinearEmbedding.cpp.

void cleanup (  )  [virtual]
SGMatrix< float64_t > find_null_space ( SGMatrix< float64_t matrix,
int  dimension,
bool  force_lapack 
) [protected]

find null space of given matrix

Parameters:
matrix given matrix
dimension dimension of null space to be computed
force_lapack true if lapack should be used
Returns:
null-space approximation feature matrix

Definition at line 240 of file LocallyLinearEmbedding.cpp.

int32_t get_k (  ) 

getter for k parameter

Returns:
k value

Definition at line 90 of file LocallyLinearEmbedding.h.

virtual const char* get_name ( void   )  const [virtual]
SGMatrix< int32_t > get_neighborhood_matrix ( CDistance distance  )  [protected]

construct neighborhood matrix by distance

Parameters:
distance distance to be used
Returns:
matrix containing indexes of neighbors of i-th object in i-th column

Definition at line 383 of file LocallyLinearEmbedding.cpp.

bool get_posdef (  ) 

getter for posdef parameter

Returns:
posdef value

Definition at line 106 of file LocallyLinearEmbedding.h.

virtual EPreprocessorType get_type (  )  const [virtual]
bool init ( CFeatures features  )  [virtual]

init

Parameters:
features 

Reimplemented from CDimensionReductionPreprocessor.

Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.

Definition at line 99 of file LocallyLinearEmbedding.cpp.

void init ( void   )  [protected]

default init

Reimplemented from CDimensionReductionPreprocessor.

Reimplemented in CKernelLocallyLinearEmbedding.

Definition at line 85 of file LocallyLinearEmbedding.cpp.

void * run_linearreconstruction_thread ( void *  p  )  [static, protected]

runs linear reconstruction thread

Parameters:
p thread params

Reimplemented in CKernelLocallyLinearEmbedding.

Definition at line 307 of file LocallyLinearEmbedding.cpp.

void * run_neighborhood_thread ( void *  p  )  [static, protected]

runs neighborhood determination thread

Parameters:
p thread params

Reimplemented in CKernelLocallyLinearEmbedding.

Definition at line 445 of file LocallyLinearEmbedding.cpp.

void set_k ( int32_t  k  ) 

setter for k parameter

Parameters:
k k

Definition at line 82 of file LocallyLinearEmbedding.h.

void set_posdef ( bool  posdef  ) 

setter for posdef parameter

Parameters:
posdef posdef value

Definition at line 98 of file LocallyLinearEmbedding.h.


Member Data Documentation

int32_t m_k [protected]

number of neighbors

Definition at line 150 of file LocallyLinearEmbedding.h.

bool m_posdef [protected]

boolean indicating if matrix should be considered as positive-definite

Definition at line 153 of file LocallyLinearEmbedding.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation