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 Fernando José Iglesias García 00008 * Copyright (C) 2012 Fernando José Iglesias García 00009 */ 00010 00011 #ifndef _LINEAR_STRUCTURED_OUTPUT_MACHINE__H__ 00012 #define _LINEAR_STRUCTURED_OUTPUT_MACHINE__H__ 00013 00014 #include <shogun/features/Features.h> 00015 #include <shogun/machine/StructuredOutputMachine.h> 00016 00017 namespace shogun 00018 { 00019 00021 class CLinearStructuredOutputMachine : public CStructuredOutputMachine 00022 { 00023 public: 00025 CLinearStructuredOutputMachine(); 00026 00033 CLinearStructuredOutputMachine(CStructuredModel* model, CLossFunction* loss, CStructuredLabels* labs); 00034 00036 virtual ~CLinearStructuredOutputMachine(); 00037 00042 void set_features(CFeatures* f); 00043 00048 CFeatures* get_features() const; 00049 00054 SGVector< float64_t > get_w() const; 00055 00064 virtual CStructuredLabels* apply_structured(CFeatures* data = NULL); 00065 00067 virtual const char* get_name() const 00068 { 00069 return "LinearStructuredOutputMachine"; 00070 } 00071 00072 private: 00074 void register_parameters(); 00075 00076 protected: 00078 CFeatures* m_features; 00079 00081 SGVector< float64_t > m_w; 00082 00083 }; /* class CLinearStructuredOutputMachine */ 00084 00085 } /* namespace shogun */ 00086 00087 #endif /* _LINEAR_STRUCTURED_OUTPUT_MACHINE__H__ */