SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIClassifier.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2008 Soeren Sonnenburg
8  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _GUICLASSIFIER_H__
12 #define _GUICLASSIFIER_H__
13 
14 #include <shogun/lib/config.h>
15 #include <shogun/base/SGObject.h>
16 #include <shogun/machine/Machine.h>
18 
19 namespace shogun
20 {
21 class CSGInterface;
22 
24 class CGUIClassifier : public CSGObject
25 {
26  public:
32  CGUIClassifier(CSGInterface* interface);
35 
37  bool new_classifier(char* name, int32_t d=6, int32_t from_d=40);
41  bool load(char* filename, char* type);
45  bool save(char* param);
47  CLabels* classify();
60  bool classify_example(int32_t idx, float64_t& result);
62  inline CMachine* get_classifier() { return classifier; }
63 
74  float64_t* &weights, int32_t& rows, int32_t& cols,
75  float64_t*& bias, int32_t& brows, int32_t& bcols,
76  int32_t idx=-1); // which SVM in Multiclass
77 
79  int32_t get_num_svms();
89  bool get_svm(
90  float64_t* &weights, int32_t& rows, int32_t& cols,
91  float64_t*& bias, int32_t& brows, int32_t& bcols,
92  int32_t idx=-1); // which SVM in Multiclass
101  bool get_linear(
102  float64_t* &weights, int32_t& rows, int32_t& cols,
103  float64_t*& bias, int32_t& brows, int32_t& bcols);
112  bool get_clustering(
113  float64_t* &weights, int32_t& rows, int32_t& cols,
114  float64_t*& bias, int32_t& brows, int32_t& bcols);
115 
116  // perceptron learnrate & maxiter
121  bool set_perceptron_parameters(float64_t lernrate, int32_t maxiter);
122 
123  // SVM functions
128  bool set_svm_C(float64_t C1, float64_t C2);
132  bool set_svm_bufsize(int32_t bufsize);
136  bool set_svm_qpsize(int32_t qpsize);
140  bool set_svm_max_qpsize(int32_t max_qpsize);
144  bool set_svm_shrinking_enabled(bool enabled);
148  bool set_svm_nu(float64_t nu);
152  bool set_svm_batch_computation_enabled(bool enabled);
156  bool set_do_auc_maximization(bool do_auc);
160  bool set_svm_linadd_enabled(bool enabled);
164  bool set_svm_bias_enabled(bool enabled);
168  bool set_mkl_interleaved_enabled(bool enabled);
176  bool set_svr_tube_epsilon(float64_t tube_epsilon);
183  float64_t weight_epsilon, float64_t C_mkl, float64_t mkl_norm);
187  bool set_mkl_block_norm(float64_t mkl_bnorm);
191  bool set_elasticnet_lambda(float64_t lambda);
195  bool set_svm_precompute_enabled(int32_t precompute);
196 
198  bool set_krr_tau(float64_t tau=1);
200  bool set_solver(char* solver);
202  bool set_constraint_generator(char* cg);
203 
205  bool train_mkl_multiclass();
207  bool train_mkl();
209  bool train_svm();
211  bool train_knn(int32_t k=3);
213  bool train_krr();
215  bool train_clustering(int32_t k=3, int32_t max_iter=1000);
219  bool train_linear(float64_t gamma=0);
221  bool train_sparse_linear();
223  bool train_wdocas();
224 
226  virtual const char* get_name() const { return "GUIClassifier"; }
227 
228  protected:
230  CSGInterface* ui;
240  int32_t svm_qpsize;
242  int32_t svm_bufsize;
244  int32_t svm_max_qpsize;
285 
290 };
291 }
292 #endif

SHOGUN Machine Learning Toolbox - Documentation