SHOGUN
v3.2.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2012-2013 Fernando José Iglesias García 00008 * Copyright (C) 2012-2013 Fernando José Iglesias García 00009 */ 00010 00011 #ifndef STOCHASTICPROXIMITYEMBEDDING_H_ 00012 #define STOCHASTICPROXIMITYEMBEDDING_H_ 00013 #include <shogun/lib/config.h> 00014 #ifdef HAVE_EIGEN3 00015 #include <shogun/converter/EmbeddingConverter.h> 00016 #include <shogun/features/Features.h> 00017 #include <shogun/distance/Distance.h> 00018 00019 namespace shogun 00020 { 00021 00023 enum ESPEStrategy 00024 { 00025 SPE_GLOBAL, 00026 SPE_LOCAL, 00027 }; 00028 00063 class CStochasticProximityEmbedding : public CEmbeddingConverter 00064 { 00065 00066 public: 00067 00069 CStochasticProximityEmbedding(); 00070 00072 virtual ~CStochasticProximityEmbedding(); 00073 00079 virtual CFeatures* apply(CFeatures* features); 00080 00085 void set_k(int32_t k); 00086 00091 int32_t get_k() const; 00092 00097 void set_strategy(ESPEStrategy strategy); 00098 00103 ESPEStrategy get_strategy() const; 00104 00109 void set_tolerance(float32_t tolerance); 00110 00115 int32_t get_tolerance() const; 00116 00121 void set_nupdates(int32_t nupdates); 00122 00127 int32_t get_nupdates() const; 00128 00133 void set_max_iteration(const int32_t max_iteration); 00134 00139 int32_t get_max_iteration() const; 00140 00142 virtual const char* get_name() const; 00143 00144 private: 00145 00147 void init(); 00148 00153 virtual CDenseFeatures< float64_t >* embed_distance(CDistance* distance); 00154 00155 private: 00156 00158 ESPEStrategy m_strategy; 00159 00161 int32_t m_k; 00162 00164 float32_t m_tolerance; 00165 00167 int32_t m_nupdates; 00168 00170 int32_t m_max_iteration; 00171 00172 }; 00173 00174 } /* namespace shogun */ 00175 00176 00177 #endif /* HAVE_EIGEN3 */ 00178 #endif /* STOCHASTICPROXIMITYEMBEDDING_H_ */