#include <svm.h>
Inheritance diagram for SVM:
Public Member Functions | |
SVM (const kernel::Kernel &=_svm_ker, UINT n_in=0) | |
SVM (const SVM &) | |
SVM (std::istream &is) | |
virtual | ~SVM () |
const SVM & | operator= (const SVM &) |
virtual const id_t & | id () const |
virtual SVM * | create () const |
Create a new object using the default constructor. | |
virtual SVM * | clone () const |
Create a new object by replicating itself. | |
REAL | C () const |
void | set_C (REAL) |
UINT | n_support_vectors () const |
Input | support_vector (UINT) const |
REAL | support_vector_coef (UINT) const |
REAL | bias () const |
REAL | kernel (const Input &, const Input &) const |
virtual bool | support_weighted_data () const |
Whether the learning model/algorithm supports unequally weighted data. | |
virtual void | initialize () |
Initialize the model for training. | |
virtual REAL | train () |
Train with preset data set and sample weight. | |
virtual Output | operator() (const Input &) const |
virtual REAL | margin_norm () const |
The normalization term for margins. | |
virtual REAL | margin_of (const Input &, const Output &) const |
Report the (unnormalized) margin of an example (x, y). | |
REAL | w_norm () const |
Protected Member Functions | |
REAL | signed_margin (const Input &) const |
(positive belief means the larger label) | |
virtual bool | serialize (std::ostream &, ver_list &) const |
virtual bool | unserialize (std::istream &, ver_list &, const id_t &=empty_id) |
Definition at line 21 of file svm.h.
|
Definition at line 187 of file svm.cpp. References Kernel::set_params(). Referenced by SVM::clone(), and SVM::create(). |
|
Definition at line 192 of file svm.cpp. References SVM::detail. |
|
|
|
|
|
Definition at line 337 of file svm.cpp. Referenced by SVM::signed_margin(). |
|
|
|
Create a new object by replicating itself.
return new Derived(*this);
Implements LearnModel. Definition at line 35 of file svm.h. References SVM::SVM(). |
|
Create a new object using the default constructor. The code for a derived class Derived is always return new Derived(); Implements LearnModel. Definition at line 34 of file svm.h. References SVM::SVM(). |
|
Implements Object. |
|
Initialize the model for training.
Reimplemented from LearnModel. |
|
Definition at line 224 of file svm.cpp. References EPSILON, and lemga::fill_svm_node(). |
|
The normalization term for margins. The margin concept can be normalized or unnormalized. For example, for a perceptron model, the unnormalized margin would be the wegithed sum of the input features, and the normalized margin would be the distance to the hyperplane, and the normalization term is the norm of the hyperplane weight. Since the normalization term is usually a constant, it would be more efficient if it is precomputed instead of being calculated every time when a margin is asked for. The best way is to use a cache. Here I use a easier way: let the users decide when to compute the normalization term. Reimplemented from LearnModel. Definition at line 51 of file svm.h. References SVM::w_norm(). |
|
Report the (unnormalized) margin of an example (x, y).
Reimplemented from LearnModel. Definition at line 247 of file svm.cpp. References INFINITESIMAL, and SVM::signed_margin(). |
|
Definition at line 219 of file svm.cpp. Referenced by Perceptron::Perceptron(), SVM::signed_margin(), SVM::support_vector(), SVM::support_vector_coef(), and SVM::w_norm(). |
|
Implements LearnModel. Definition at line 299 of file svm.cpp. References lemga::fill_svm_node(), INFINITESIMAL, LearnModel::n_input(), and SVM::signed_margin(). |
|
Definition at line 200 of file svm.cpp. References SVM::detail, and OBJ_FUNC_UNDEFINED. |
|
Reimplemented from LearnModel. Definition at line 179 of file svm.cpp. References OBJ_FUNC_UNDEFINED. |
|
|
|
(positive belief means the larger label)
Definition at line 252 of file svm.cpp. References SVM::bias(), EPSILON, lemga::fill_svm_node(), LearnModel::n_input(), SVM::n_support_vectors(), SVM::support_vector(), and SVM::support_vector_coef(). Referenced by SVM::margin_of(), and SVM::operator()(). |
|
Definition at line 314 of file svm.cpp. References LearnModel::_n_in, and SVM::n_support_vectors(). Referenced by Perceptron::Perceptron(), SVM::signed_margin(), and SVM::w_norm(). |
|
Definition at line 328 of file svm.cpp. References SVM::n_support_vectors(). Referenced by Perceptron::Perceptron(), SVM::signed_margin(), and SVM::w_norm(). |
|
Whether the learning model/algorithm supports unequally weighted data.
Reimplemented from LearnModel. |
|
Train with preset data set and sample weight.
Implements LearnModel. Definition at line 240 of file svm.cpp. References LearnModel::n_input(), and LearnModel::n_output(). |
|
Reimplemented from LearnModel. Definition at line 183 of file svm.cpp. References OBJ_FUNC_UNDEFINED. |
|
Definition at line 275 of file svm.cpp. References EPSILON, SVM::n_support_vectors(), SVM::support_vector(), and SVM::support_vector_coef(). Referenced by SVM::margin_norm(). |