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 Viktor Gal 00008 * Copyright (C) 2012 Viktor Gal 00009 */ 00010 00011 #ifndef __LATENTFEATURES_H__ 00012 #define __LATENTFEATURES_H__ 00013 00014 #include <shogun/features/Features.h> 00015 #include <shogun/lib/Data.h> 00016 00017 namespace shogun 00018 { 00024 class CLatentFeatures : public CFeatures 00025 { 00026 public: 00028 CLatentFeatures(); 00029 00034 CLatentFeatures(int32_t num_samples); 00035 00036 virtual ~CLatentFeatures(); 00037 00042 virtual CFeatures* duplicate() const; 00043 00048 virtual EFeatureType get_feature_type() const; 00049 00054 virtual EFeatureClass get_feature_class() const; 00055 00060 virtual int32_t get_num_vectors() const; 00061 00068 virtual int32_t get_size() const; 00069 00074 virtual const char* get_name() const { return "LatentFeatures"; } 00075 00080 bool add_sample(CData* example); 00081 00087 CData* get_sample(index_t idx); 00088 00093 static CLatentFeatures* obtain_from_generic(CFeatures* base_feats); 00094 protected: 00096 CDynamicObjectArray* m_samples; 00097 00098 private: 00100 void init(); 00101 }; 00102 } 00103 00104 #endif /* __LATENTFEATURES_H__ */ 00105