SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FactorAnalysis.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Fernando J. Iglesias Garcia
8  * Copyright (C) 2011-2013 Fernando J. Iglesias Garcia
9  */
10 
12 #include <shogun/lib/tapkee/tapkee_shogun.hpp>
14 
15 using namespace shogun;
16 
19 {
20  // Sentinel value, it will be set appropriately if not modified by set_max_iteration
21  m_max_iteration = 0;
22  m_epsilon = 1e-5;
23  init();
24 }
25 
26 void CFactorAnalysis::init()
27 {
28  SG_ADD(&m_max_iteration, "max_iteration", "maximum number of iterations", MS_NOT_AVAILABLE);
29  SG_ADD(&m_epsilon, "epsilon", "convergence parameter", MS_NOT_AVAILABLE);
30 }
31 
33 {
34 }
35 
36 const char* CFactorAnalysis::get_name() const
37 {
38  return "FactorAnalysis";
39 }
40 
41 void CFactorAnalysis::set_max_iteration(const int32_t max_iteration)
42 {
43  m_max_iteration = max_iteration;
44 }
45 
47 {
48  return m_max_iteration;
49 }
50 
52 {
53  m_epsilon = epsilon;
54 }
55 
57 {
58  return m_epsilon;
59 }
60 
62 {
63  TAPKEE_PARAMETERS_FOR_SHOGUN parameters;
64  parameters.max_iteration = m_max_iteration;
65  parameters.features = (CDotFeatures*)features;
66  parameters.fa_epsilon = m_epsilon;
67  parameters.method = SHOGUN_FACTOR_ANALYSIS;
68  parameters.target_dimension = m_target_dim;
69  CDenseFeatures<float64_t>* embedding = tapkee_embed(parameters);
70  return embedding;
71 }
72 
float64_t get_epsilon() const
class EmbeddingConverter (part of the Efficient Dimensionality Reduction Toolkit) used to construct e...
void set_max_iteration(const int32_t max_iteration)
void set_epsilon(const float64_t epsilon)
Features that support dot products among other operations.
Definition: DotFeatures.h:44
double float64_t
Definition: common.h:50
virtual CFeatures * apply(CFeatures *features)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual const char * get_name() const
The class Features is the base class of all feature objects.
Definition: Features.h:68
#define SG_ADD(...)
Definition: SGObject.h:84
int32_t get_max_iteration() const

SHOGUN Machine Learning Toolbox - Documentation