15 #include <shogun/lib/tapkee/tapkee_shogun.hpp>
17 using namespace shogun;
32 void CStochasticProximityEmbedding::init()
37 SG_ADD(&m_tolerance,
"m_tolerance",
"Regularization parameter",
39 SG_ADD(&m_max_iteration,
"max_iteration",
"maximum number of iterations",
50 SG_ERROR(
"Number of neighbors k must be greater than 0")
62 m_strategy = strategy;
73 SG_ERROR(
"Tolerance regularization parameter must be greater "
76 m_tolerance = tolerance;
87 SG_ERROR(
"The number of updates must be greater than 0")
89 m_nupdates = nupdates;
99 m_max_iteration = max_iteration;
104 return m_max_iteration;
109 return "StochasticProximityEmbedding";
115 SG_ERROR(
"Features are required to apply SPE\n")
124 if ( m_strategy ==
SPE_LOCAL && m_k >= N )
125 SG_ERROR(
"The number of neighbors (%d) must be less than "
126 "the number of vectors (%d)\n", m_k, N);
128 if ( 2*m_nupdates > N )
129 SG_ERROR(
"The number of vectors (%d) must be at least two times "
130 "the number of updates (%d)\n", N, m_nupdates);
142 TAPKEE_PARAMETERS_FOR_SHOGUN parameters;
143 parameters.n_neighbors = m_k;
144 parameters.method = SHOGUN_STOCHASTIC_PROXIMITY_EMBEDDING;
146 parameters.spe_num_updates = m_nupdates;
147 parameters.spe_tolerance = m_tolerance;
149 parameters.spe_global_strategy = (m_strategy==
SPE_GLOBAL);
150 parameters.max_iteration = m_max_iteration;