10 #ifndef MULTITASKMACHINE_H_ 11 #define MULTITASKMACHINE_H_ 13 #include <shogun/lib/config.h> 29 class CMultitaskLinearMachine :
public CLinearMachine
34 CMultitaskLinearMachine();
42 CMultitaskLinearMachine(
43 CDotFeatures* training_data,
44 CLabels* training_labels, CTaskRelation* task_relation);
47 virtual ~CMultitaskLinearMachine();
50 virtual const char* get_name()
const 52 return "MultitaskLinearMachine";
58 int32_t get_current_task()
const;
63 void set_current_task(int32_t task);
69 virtual SGVector<float64_t> get_w()
const;
75 virtual void set_w(
const SGVector<float64_t> src_w);
92 CTaskRelation* get_task_relation()
const;
97 void set_task_relation(CTaskRelation* task_relation);
100 virtual bool supports_locking()
const {
return true; }
103 virtual void post_lock(CLabels* labels, CFeatures* features_);
105 #ifndef SWIG // SWIG should skip this part 107 virtual bool train_locked(SGVector<index_t> indices);
110 virtual CBinaryLabels* apply_locked_binary(SGVector<index_t> indices);
111 #endif // SWIG // SWIG should skip this part 119 virtual SGVector<float64_t> apply_get_outputs(CFeatures* data=NULL);
122 virtual bool train_machine(CFeatures* data=NULL);
125 virtual bool train_locked_implementation(SGVector<index_t>* tasks);
128 SGVector<index_t>* get_subset_tasks_indices();
133 void register_parameters();
138 int32_t m_current_task;
141 CTaskRelation* m_task_relation;
144 SGMatrix<float64_t> m_tasks_w;
147 SGVector<float64_t> m_tasks_c;
150 std::vector< std::set<index_t> > m_tasks_indices;
154 #endif //USE_GPL_SHOGUN
all of classes and functions are contained in the shogun namespace