SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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
bool set_perceptron_parameters(float64_t lernrate, int32_t maxiter)
bool set_svm_epsilon(float64_t epsilon)
bool get_trained_classifier(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols, int32_t idx=-1)
bool set_svm_shrinking_enabled(bool enabled)
CSGInterface * interface
Definition: SGInterface.cpp:45
bool set_svm_linadd_enabled(bool enabled)
bool train_knn(int32_t k=3)
bool set_constraint_generator(char *cg)
bool train_clustering(int32_t k=3, int32_t max_iter=1000)
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
bool set_svm_mkl_parameters(float64_t weight_epsilon, float64_t C_mkl, float64_t mkl_norm)
float64_t perceptron_learnrate
bool set_do_auc_maximization(bool do_auc)
bool set_svm_nu(float64_t nu)
ESolverType
Definition: Machine.h:98
bool save(char *param)
A generic learning machine interface.
Definition: Machine.h:143
UI classifier.
Definition: GUIClassifier.h:24
bool classify_example(int32_t idx, float64_t &result)
bool set_svm_batch_computation_enabled(bool enabled)
CLabels * classify_distancemachine()
static const float64_t epsilon
Definition: libbmrm.cpp:25
CLabels * classify_kernelmachine()
bool new_classifier(char *name, int32_t d=6, int32_t from_d=40)
bool set_svr_tube_epsilon(float64_t tube_epsilon)
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
bool set_svm_max_qpsize(int32_t max_qpsize)
bool set_solver(char *solver)
double float64_t
Definition: common.h:50
bool set_mkl_block_norm(float64_t mkl_bnorm)
bool set_mkl_interleaved_enabled(bool enabled)
CMachine * get_classifier()
Definition: GUIClassifier.h:62
bool set_svm_bufsize(int32_t bufsize)
bool set_svm_bias_enabled(bool enabled)
bool set_svm_precompute_enabled(int32_t precompute)
bool get_clustering(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols)
bool get_svm(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols, int32_t idx=-1)
bool get_linear(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols)
bool train_linear(float64_t gamma=0)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
A generic Support Vector Machine Interface.
Definition: SVM.h:49
CLabels * classify_byte_linear()
Matrix::Scalar max(Matrix m)
Definition: Redux.h:66
virtual const char * get_name() const
bool set_krr_tau(float64_t tau=1)
bool set_svm_C(float64_t C1, float64_t C2)
bool load(char *filename, char *type)
bool set_elasticnet_lambda(float64_t lambda)
bool set_svm_qpsize(int32_t qpsize)
bool set_max_train_time(float64_t max)

SHOGUN Machine Learning Toolbox - Documentation