SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #ifdef HAVE_EIGEN3
13 #include <shogun/lib/tapkee/tapkee_shogun.hpp>
15 
16 using namespace shogun;
17 
20 {
21  // Sentinel value, it will be set appropriately if not modified by set_max_iteration
22  m_max_iteration = 0;
23  m_epsilon = 1e-5;
24  init();
25 }
26 
27 void CFactorAnalysis::init()
28 {
29  SG_ADD(&m_max_iteration, "max_iteration", "maximum number of iterations", MS_NOT_AVAILABLE);
30  SG_ADD(&m_epsilon, "epsilon", "convergence parameter", MS_NOT_AVAILABLE);
31 }
32 
34 {
35 }
36 
37 const char* CFactorAnalysis::get_name() const
38 {
39  return "FactorAnalysis";
40 }
41 
42 void CFactorAnalysis::set_max_iteration(const int32_t max_iteration)
43 {
44  m_max_iteration = max_iteration;
45 }
46 
48 {
49  return m_max_iteration;
50 }
51 
53 {
54  m_epsilon = epsilon;
55 }
56 
58 {
59  return m_epsilon;
60 }
61 
63 {
64  TAPKEE_PARAMETERS_FOR_SHOGUN parameters;
65  parameters.max_iteration = m_max_iteration;
66  parameters.features = (CDotFeatures*)features;
67  parameters.fa_epsilon = m_epsilon;
68  parameters.method = SHOGUN_FACTOR_ANALYSIS;
69  parameters.target_dimension = m_target_dim;
70  CDenseFeatures<float64_t>* embedding = tapkee_embed(parameters);
71  return embedding;
72 }
73 
74 #endif /* HAVE_EIGEN */

SHOGUN Machine Learning Toolbox - Documentation