14 #include <shogun/lib/tapkee/tapkee_shogun.hpp>
31 void CStochasticProximityEmbedding::init()
36 SG_ADD(&m_tolerance,
"m_tolerance",
"Regularization parameter",
38 SG_ADD(&m_max_iteration,
"max_iteration",
"maximum number of iterations",
49 SG_ERROR(
"Number of neighbors k must be greater than 0")
61 m_strategy = strategy;
72 SG_ERROR(
"Tolerance regularization parameter must be greater "
75 m_tolerance = tolerance;
86 SG_ERROR(
"The number of updates must be greater than 0")
88 m_nupdates = nupdates;
98 m_max_iteration = max_iteration;
103 return m_max_iteration;
108 return "StochasticProximityEmbedding";
114 SG_ERROR(
"Features are required to apply SPE\n")
123 if ( m_strategy ==
SPE_LOCAL && m_k >= N )
124 SG_ERROR(
"The number of neighbors (%d) must be less than "
125 "the number of vectors (%d)\n", m_k, N);
127 if ( 2*m_nupdates > N )
128 SG_ERROR(
"The number of vectors (%d) must be at least two times "
129 "the number of updates (%d)\n", N, m_nupdates);
141 TAPKEE_PARAMETERS_FOR_SHOGUN parameters;
142 parameters.n_neighbors = m_k;
143 parameters.method = SHOGUN_STOCHASTIC_PROXIMITY_EMBEDDING;
145 parameters.spe_num_updates = m_nupdates;
146 parameters.spe_tolerance = m_tolerance;
148 parameters.spe_global_strategy = (m_strategy==
SPE_GLOBAL);
149 parameters.max_iteration = m_max_iteration;
float distance(CJLCoverTreePoint p1, CJLCoverTreePoint p2, float64_t upper_bound)
Class Distance, a base class for all the distances used in the Shogun toolbox.
virtual ~CStochasticProximityEmbedding()
virtual CFeatures * apply(CFeatures *features)
class EmbeddingConverter (part of the Efficient Dimensionality Reduction Toolkit) used to construct e...
virtual const char * get_name() const
int32_t get_max_iteration() const
int32_t get_nupdates() const
void set_tolerance(float32_t tolerance)
virtual int32_t get_num_vectors() const
virtual void remove_lhs_and_rhs()
CStochasticProximityEmbedding()
void set_max_iteration(const int32_t max_iteration)
void set_strategy(ESPEStrategy strategy)
void set_nupdates(int32_t nupdates)
all of classes and functions are contained in the shogun namespace
ESPEStrategy get_strategy() const
The class Features is the base class of all feature objects.
virtual bool init(CFeatures *lhs, CFeatures *rhs)
int32_t get_tolerance() const