TTK
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
ttk::DimensionReduction Class Reference

TTK VTK-filter that apply dimension reduction algorithms on input. More...

#include <DimensionReduction.h>

Inheritance diagram for ttk::DimensionReduction:
ttk::Debug ttk::BaseClass ttkDimensionReduction

Public Types

enum class  METHOD {
  SE = 0 , LLE = 1 , MDS = 2 , T_SNE = 3 ,
  ISOMAP = 4 , PCA = 5 , TOPOMAP = 6
}
 

Public Member Functions

 DimensionReduction ()
 
void setSEParameters (const std::string &Affinity, const float Gamma, const std::string &EigenSolver, const bool InputIsADistanceMatrix)
 
void setLLEParameters (const float Regularization, const std::string &EigenSolver, const float Tolerance, const int MaxIteration, const std::string &Method_s, const float HessianTolerance, const float ModifiedTolerance, const std::string &NeighborsAlgorithm)
 
void setMDSParameters (const bool Metric, const int Init, const int MaxIteration, const int Verbose, const float Epsilon, const bool Dissimilarity)
 
void setTSNEParameters (const float Perplexity, const float Exaggeration, const float LearningRate, const int MaxIteration, const int MaxIterationProgress, const float GradientThreshold, const std::string &Metric, const std::string &Init, const int Verbose, const std::string &Method_s, const float Angle)
 
void setISOParameters (const std::string &EigenSolver, const float Tolerance, const int MaxIteration, const std::string &PathMethod, const std::string &NeighborsAlgorithm)
 
void setPCAParameters (const bool Copy, const bool Whiten, const std::string &SVDSolver, const float Tolerance, const std::string &MaxIteration)
 
void setTopoParameters (const size_t AngularSampleNb, bool CheckMST)
 
void setInputModulePath (const std::string &modulePath)
 
void setInputModuleName (const std::string &moduleName)
 
void setInputFunctionName (const std::string &functionName)
 
void setInputMethod (METHOD method)
 
void setInputNumberOfComponents (const int numberOfComponents)
 
void setInputNumberOfNeighbors (const int numberOfNeighbors)
 
void setInputIsDeterministic (const int isDeterm)
 
void setIsInputDistanceMatrix (const bool data)
 
int execute (std::vector< std::vector< double > > &outputEmbedding, const std::vector< double > &inputMatrix, const int nRows, const int nColumns, int *insertionTimeForTopoMap=nullptr) const
 
- Public Member Functions inherited from ttk::Debug
 Debug ()
 
 ~Debug () override
 
virtual int setDebugLevel (const int &debugLevel)
 
int setWrapper (const Wrapper *wrapper) override
 
int printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
int printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const
 
void setDebugMsgPrefix (const std::string &prefix)
 
- Public Member Functions inherited from ttk::BaseClass
 BaseClass ()
 
virtual ~BaseClass ()=default
 
int getThreadNumber () const
 
virtual int setThreadNumber (const int threadNumber)
 

Protected Attributes

std::string se_Affinity {"nearest_neighbors"}
 
float se_Gamma {1}
 
std::string se_EigenSolver {"None"}
 
float lle_Regularization {1e-3}
 
std::string lle_EigenSolver {"auto"}
 
float lle_Tolerance {1e-3}
 
int lle_MaxIteration {300}
 
std::string lle_Method {"standard"}
 
float lle_HessianTolerance {1e-3}
 
float lle_ModifiedTolerance {1e-3}
 
std::string lle_NeighborsAlgorithm {"auto"}
 
bool mds_Metric {true}
 
int mds_Init {4}
 
int mds_MaxIteration {300}
 
int mds_Verbose {0}
 
float mds_Epsilon {0}
 
std::string mds_Dissimilarity {"euclidean"}
 
float tsne_Perplexity {30}
 
float tsne_Exaggeration {12}
 
float tsne_LearningRate {200}
 
int tsne_MaxIteration {1000}
 
int tsne_MaxIterationProgress {300}
 
float tsne_GradientThreshold {1e-7}
 
std::string tsne_Metric {"euclidean"}
 
std::string tsne_Init {"random"}
 
int tsne_Verbose {0}
 
std::string tsne_Method {"barnes_hut"}
 
float tsne_Angle {0.5}
 
std::string iso_EigenSolver {"auto"}
 
float iso_Tolerance {1e-3}
 
int iso_MaxIteration {300}
 
std::string iso_PathMethod {"auto"}
 
std::string iso_NeighborsAlgorithm {"auto"}
 
std::string iso_Metric {"euclidean"}
 
bool pca_Copy {true}
 
bool pca_Whiten {false}
 
std::string pca_SVDSolver {"auto"}
 
float pca_Tolerance {0}
 
std::string pca_MaxIteration {"auto"}
 
size_t topomap_AngularSampleNb
 
bool topomap_CheckMST
 
TopoMap::STRATEGY topomap_Strategy {TopoMap::STRATEGY::KRUSKAL}
 
std::string ModulePath {"default"}
 
std::string ModuleName {"dimensionReduction"}
 
std::string FunctionName {"doIt"}
 
METHOD Method
 
int NumberOfComponents {2}
 
int NumberOfNeighbors {5}
 
int IsDeterministic {true}
 
char majorVersion_ {'0'}
 
bool IsInputADistanceMatrix {false}
 
- Protected Attributes inherited from ttk::Debug
int debugLevel_
 
std::string debugMsgPrefix_
 
std::string debugMsgNamePrefix_
 
- Protected Attributes inherited from ttk::BaseClass
bool lastObject_
 
int threadNumber_
 
Wrapperwrapper_
 

Additional Inherited Members

- Protected Member Functions inherited from ttk::Debug
int printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
 
int printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const
 
int welcomeMsg (std::ostream &stream)
 
- Static Protected Attributes inherited from ttk::Debug
static COMMON_EXPORTS debug::LineMode lastLineMode = ttk::debug::LineMode::NEW
 

Detailed Description

TTK VTK-filter that apply dimension reduction algorithms on input.

Author
Guillaume Favelier guill.nosp@m.aume.nosp@m..fave.nosp@m.lier.nosp@m.@lip6.nosp@m..fr
Date
September 2018
Parameters
InputInput scalar field (vtkTable)
OutputOutput scalar field (vtkTable)

TTK VTK-filter that takes a matrix (vtkTable) as input and apply a dimension reduction algorithm from scikit-learn.

See also
ttk::Triangulation
ttkDimensionReduction.cpp for a usage example.

Online examples:

Definition at line 60 of file DimensionReduction.h.

Member Enumeration Documentation

◆ METHOD

Scikit-Learn Dimension Reduction algorithms

Enumerator
SE 

Spectral Embedding

LLE 

Locally Linear Embedding

MDS 

Multi-Dimensional Scaling

T_SNE 

t-distributed Stochastic Neighbor Embedding

ISOMAP 

IsoMap Embedding

PCA 

Principal Component Analysis

TOPOMAP 

TopoMap

Definition at line 66 of file DimensionReduction.h.

Constructor & Destructor Documentation

◆ DimensionReduction()

DimensionReduction::DimensionReduction ( )

Definition at line 18 of file DimensionReduction.cpp.

Member Function Documentation

◆ execute()

int DimensionReduction::execute ( std::vector< std::vector< double > > &  outputEmbedding,
const std::vector< double > &  inputMatrix,
const int  nRows,
const int  nColumns,
int *  insertionTimeForTopoMap = nullptr 
) const

Definition at line 45 of file DimensionReduction.cpp.

◆ setInputFunctionName()

void ttk::DimensionReduction::setInputFunctionName ( const std::string &  functionName)
inline

Definition at line 192 of file DimensionReduction.h.

◆ setInputIsDeterministic()

void ttk::DimensionReduction::setInputIsDeterministic ( const int  isDeterm)
inline

Definition at line 243 of file DimensionReduction.h.

◆ setInputMethod()

void ttk::DimensionReduction::setInputMethod ( METHOD  method)
inline

Definition at line 196 of file DimensionReduction.h.

◆ setInputModuleName()

void ttk::DimensionReduction::setInputModuleName ( const std::string &  moduleName)
inline

Definition at line 188 of file DimensionReduction.h.

◆ setInputModulePath()

void ttk::DimensionReduction::setInputModulePath ( const std::string &  modulePath)
inline

Definition at line 184 of file DimensionReduction.h.

◆ setInputNumberOfComponents()

void ttk::DimensionReduction::setInputNumberOfComponents ( const int  numberOfComponents)
inline

Definition at line 235 of file DimensionReduction.h.

◆ setInputNumberOfNeighbors()

void ttk::DimensionReduction::setInputNumberOfNeighbors ( const int  numberOfNeighbors)
inline

Definition at line 239 of file DimensionReduction.h.

◆ setIsInputDistanceMatrix()

void ttk::DimensionReduction::setIsInputDistanceMatrix ( const bool  data)
inline

Definition at line 247 of file DimensionReduction.h.

◆ setISOParameters()

void ttk::DimensionReduction::setISOParameters ( const std::string &  EigenSolver,
const float  Tolerance,
const int  MaxIteration,
const std::string &  PathMethod,
const std::string &  NeighborsAlgorithm 
)
inline

Definition at line 156 of file DimensionReduction.h.

◆ setLLEParameters()

void ttk::DimensionReduction::setLLEParameters ( const float  Regularization,
const std::string &  EigenSolver,
const float  Tolerance,
const int  MaxIteration,
const std::string &  Method_s,
const float  HessianTolerance,
const float  ModifiedTolerance,
const std::string &  NeighborsAlgorithm 
)
inline

Definition at line 96 of file DimensionReduction.h.

◆ setMDSParameters()

void ttk::DimensionReduction::setMDSParameters ( const bool  Metric,
const int  Init,
const int  MaxIteration,
const int  Verbose,
const float  Epsilon,
const bool  Dissimilarity 
)
inline

Definition at line 114 of file DimensionReduction.h.

◆ setPCAParameters()

void ttk::DimensionReduction::setPCAParameters ( const bool  Copy,
const bool  Whiten,
const std::string &  SVDSolver,
const float  Tolerance,
const std::string &  MaxIteration 
)
inline

Definition at line 168 of file DimensionReduction.h.

◆ setSEParameters()

void ttk::DimensionReduction::setSEParameters ( const std::string &  Affinity,
const float  Gamma,
const std::string &  EigenSolver,
const bool  InputIsADistanceMatrix 
)
inline

Definition at line 83 of file DimensionReduction.h.

◆ setTopoParameters()

void ttk::DimensionReduction::setTopoParameters ( const size_t  AngularSampleNb,
bool  CheckMST 
)
inline

Definition at line 179 of file DimensionReduction.h.

◆ setTSNEParameters()

void ttk::DimensionReduction::setTSNEParameters ( const float  Perplexity,
const float  Exaggeration,
const float  LearningRate,
const int  MaxIteration,
const int  MaxIterationProgress,
const float  GradientThreshold,
const std::string &  Metric,
const std::string &  Init,
const int  Verbose,
const std::string &  Method_s,
const float  Angle 
)
inline

Definition at line 132 of file DimensionReduction.h.

Member Data Documentation

◆ FunctionName

std::string ttk::DimensionReduction::FunctionName {"doIt"}
protected

Definition at line 328 of file DimensionReduction.h.

◆ IsDeterministic

int ttk::DimensionReduction::IsDeterministic {true}
protected

Definition at line 334 of file DimensionReduction.h.

◆ IsInputADistanceMatrix

bool ttk::DimensionReduction::IsInputADistanceMatrix {false}
protected

Definition at line 336 of file DimensionReduction.h.

◆ iso_EigenSolver

std::string ttk::DimensionReduction::iso_EigenSolver {"auto"}
protected

Definition at line 306 of file DimensionReduction.h.

◆ iso_MaxIteration

int ttk::DimensionReduction::iso_MaxIteration {300}
protected

Definition at line 308 of file DimensionReduction.h.

◆ iso_Metric

std::string ttk::DimensionReduction::iso_Metric {"euclidean"}
protected

Definition at line 311 of file DimensionReduction.h.

◆ iso_NeighborsAlgorithm

std::string ttk::DimensionReduction::iso_NeighborsAlgorithm {"auto"}
protected

Definition at line 310 of file DimensionReduction.h.

◆ iso_PathMethod

std::string ttk::DimensionReduction::iso_PathMethod {"auto"}
protected

Definition at line 309 of file DimensionReduction.h.

◆ iso_Tolerance

float ttk::DimensionReduction::iso_Tolerance {1e-3}
protected

Definition at line 307 of file DimensionReduction.h.

◆ lle_EigenSolver

std::string ttk::DimensionReduction::lle_EigenSolver {"auto"}
protected

Definition at line 276 of file DimensionReduction.h.

◆ lle_HessianTolerance

float ttk::DimensionReduction::lle_HessianTolerance {1e-3}
protected

Definition at line 280 of file DimensionReduction.h.

◆ lle_MaxIteration

int ttk::DimensionReduction::lle_MaxIteration {300}
protected

Definition at line 278 of file DimensionReduction.h.

◆ lle_Method

std::string ttk::DimensionReduction::lle_Method {"standard"}
protected

Definition at line 279 of file DimensionReduction.h.

◆ lle_ModifiedTolerance

float ttk::DimensionReduction::lle_ModifiedTolerance {1e-3}
protected

Definition at line 281 of file DimensionReduction.h.

◆ lle_NeighborsAlgorithm

std::string ttk::DimensionReduction::lle_NeighborsAlgorithm {"auto"}
protected

Definition at line 282 of file DimensionReduction.h.

◆ lle_Regularization

float ttk::DimensionReduction::lle_Regularization {1e-3}
protected

Definition at line 275 of file DimensionReduction.h.

◆ lle_Tolerance

float ttk::DimensionReduction::lle_Tolerance {1e-3}
protected

Definition at line 277 of file DimensionReduction.h.

◆ majorVersion_

char ttk::DimensionReduction::majorVersion_ {'0'}
protected

Definition at line 335 of file DimensionReduction.h.

◆ mds_Dissimilarity

std::string ttk::DimensionReduction::mds_Dissimilarity {"euclidean"}
protected

Definition at line 290 of file DimensionReduction.h.

◆ mds_Epsilon

float ttk::DimensionReduction::mds_Epsilon {0}
protected

Definition at line 289 of file DimensionReduction.h.

◆ mds_Init

int ttk::DimensionReduction::mds_Init {4}
protected

Definition at line 286 of file DimensionReduction.h.

◆ mds_MaxIteration

int ttk::DimensionReduction::mds_MaxIteration {300}
protected

Definition at line 287 of file DimensionReduction.h.

◆ mds_Metric

bool ttk::DimensionReduction::mds_Metric {true}
protected

Definition at line 285 of file DimensionReduction.h.

◆ mds_Verbose

int ttk::DimensionReduction::mds_Verbose {0}
protected

Definition at line 288 of file DimensionReduction.h.

◆ Method

METHOD ttk::DimensionReduction::Method
protected

Definition at line 330 of file DimensionReduction.h.

◆ ModuleName

std::string ttk::DimensionReduction::ModuleName {"dimensionReduction"}
protected

Definition at line 327 of file DimensionReduction.h.

◆ ModulePath

std::string ttk::DimensionReduction::ModulePath {"default"}
protected

Definition at line 326 of file DimensionReduction.h.

◆ NumberOfComponents

int ttk::DimensionReduction::NumberOfComponents {2}
protected

Definition at line 332 of file DimensionReduction.h.

◆ NumberOfNeighbors

int ttk::DimensionReduction::NumberOfNeighbors {5}
protected

Definition at line 333 of file DimensionReduction.h.

◆ pca_Copy

bool ttk::DimensionReduction::pca_Copy {true}
protected

Definition at line 314 of file DimensionReduction.h.

◆ pca_MaxIteration

std::string ttk::DimensionReduction::pca_MaxIteration {"auto"}
protected

Definition at line 318 of file DimensionReduction.h.

◆ pca_SVDSolver

std::string ttk::DimensionReduction::pca_SVDSolver {"auto"}
protected

Definition at line 316 of file DimensionReduction.h.

◆ pca_Tolerance

float ttk::DimensionReduction::pca_Tolerance {0}
protected

Definition at line 317 of file DimensionReduction.h.

◆ pca_Whiten

bool ttk::DimensionReduction::pca_Whiten {false}
protected

Definition at line 315 of file DimensionReduction.h.

◆ se_Affinity

std::string ttk::DimensionReduction::se_Affinity {"nearest_neighbors"}
protected

Definition at line 270 of file DimensionReduction.h.

◆ se_EigenSolver

std::string ttk::DimensionReduction::se_EigenSolver {"None"}
protected

Definition at line 272 of file DimensionReduction.h.

◆ se_Gamma

float ttk::DimensionReduction::se_Gamma {1}
protected

Definition at line 271 of file DimensionReduction.h.

◆ topomap_AngularSampleNb

size_t ttk::DimensionReduction::topomap_AngularSampleNb
protected

Definition at line 321 of file DimensionReduction.h.

◆ topomap_CheckMST

bool ttk::DimensionReduction::topomap_CheckMST
protected

Definition at line 322 of file DimensionReduction.h.

◆ topomap_Strategy

TopoMap::STRATEGY ttk::DimensionReduction::topomap_Strategy {TopoMap::STRATEGY::KRUSKAL}
protected

Definition at line 323 of file DimensionReduction.h.

◆ tsne_Angle

float ttk::DimensionReduction::tsne_Angle {0.5}
protected

Definition at line 303 of file DimensionReduction.h.

◆ tsne_Exaggeration

float ttk::DimensionReduction::tsne_Exaggeration {12}
protected

Definition at line 294 of file DimensionReduction.h.

◆ tsne_GradientThreshold

float ttk::DimensionReduction::tsne_GradientThreshold {1e-7}
protected

Definition at line 298 of file DimensionReduction.h.

◆ tsne_Init

std::string ttk::DimensionReduction::tsne_Init {"random"}
protected

Definition at line 300 of file DimensionReduction.h.

◆ tsne_LearningRate

float ttk::DimensionReduction::tsne_LearningRate {200}
protected

Definition at line 295 of file DimensionReduction.h.

◆ tsne_MaxIteration

int ttk::DimensionReduction::tsne_MaxIteration {1000}
protected

Definition at line 296 of file DimensionReduction.h.

◆ tsne_MaxIterationProgress

int ttk::DimensionReduction::tsne_MaxIterationProgress {300}
protected

Definition at line 297 of file DimensionReduction.h.

◆ tsne_Method

std::string ttk::DimensionReduction::tsne_Method {"barnes_hut"}
protected

Definition at line 302 of file DimensionReduction.h.

◆ tsne_Metric

std::string ttk::DimensionReduction::tsne_Metric {"euclidean"}
protected

Definition at line 299 of file DimensionReduction.h.

◆ tsne_Perplexity

float ttk::DimensionReduction::tsne_Perplexity {30}
protected

Definition at line 293 of file DimensionReduction.h.

◆ tsne_Verbose

int ttk::DimensionReduction::tsne_Verbose {0}
protected

Definition at line 301 of file DimensionReduction.h.


The documentation for this class was generated from the following files: