#include <svm.h>
Inheritance diagram for SVM:
Public Member Functions | |
SVM (UINT n_in=0) | |
SVM (const kernel::Kernel &, UINT n_in=0) | |
SVM (const SVM &) | |
SVM (std::istream &) | |
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 c) |
UINT | n_support_vectors () const |
const Input & | support_vector (UINT i) const |
REAL | support_vector_coef (UINT i) const |
REAL | bias () const |
const kernel::Kernel & | kernel () const |
REAL | kernel (const Input &, const Input &) const |
void | set_kernel (const kernel::Kernel &) |
virtual bool | support_weighted_data () const |
Whether the learning model/algorithm supports unequally weighted data. | |
virtual void | initialize () |
virtual void | 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) | |
void | reset_model () |
virtual bool | serialize (std::ostream &, ver_list &) const |
virtual bool | unserialize (std::istream &, ver_list &, const id_t &=NIL_ID) |
Definition at line 19 of file svm.h.
|
Definition at line 232 of file svm.cpp. Referenced by SVM::clone(), and SVM::create(). |
|
Definition at line 236 of file svm.cpp. References SVM::set_kernel(). |
|
Definition at line 242 of file svm.cpp. References SVM::detail, SVM::ker, and SVM::set_kernel(). |
|
|
|
|
|
Definition at line 47 of file svm.h. Referenced by SVM::signed_margin(). |
|
|
|
Create a new object by replicating itself.
return new Derived(*this);
Implements LearnModel. Definition at line 39 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 38 of file svm.h. References SVM::SVM(). |
|
Implements Object. |
|
Reimplemented from LearnModel. Definition at line 300 of file svm.cpp. References SVM::reset_model(). |
|
Definition at line 275 of file svm.cpp. References EPSILON, and lemga::fill_svm_node(). |
|
Definition at line 48 of file svm.h. Referenced by Perceptron::Perceptron(). |
|
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 57 of file svm.h. References SVM::w_norm(). |
|
Report the (unnormalized) margin of an example (x, y).
Reimplemented from LearnModel. Definition at line 351 of file svm.cpp. References INFINITESIMAL, and SVM::signed_margin(). |
|
Definition at line 43 of file svm.h. Referenced by Perceptron::Perceptron(), SVM::signed_margin(), and SVM::w_norm(). |
|
Implements LearnModel. Definition at line 410 of file svm.cpp. References lemga::fill_svm_node(), INFINITESIMAL, LearnModel::n_input(), and SVM::signed_margin(). |
|
Definition at line 259 of file svm.cpp. References SVM::coef, SVM::coef0, SVM::detail, SVM::ker, SVM::regC, SVM::set_kernel(), and SVM::sv. |
|
Definition at line 304 of file svm.cpp. Referenced by SVM::initialize(), SVM::set_kernel(), SVM::train(), and SVM::unserialize(). |
|
Reimplemented from LearnModel. Definition at line 179 of file svm.cpp. References LearnModel::_n_in, and SERIALIZE_PARENT. |
|
|
|
Definition at line 289 of file svm.cpp. References Kernel::clone(), SVM::reset_model(), and Kernel::set_params(). Referenced by SVM::operator=(), SVM::SVM(), and SVM::unserialize(). |
|
(positive belief means the larger label)
Definition at line 356 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 44 of file svm.h. Referenced by Perceptron::Perceptron(), SVM::signed_margin(), and SVM::w_norm(). |
|
Definition at line 46 of file svm.h. 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 309 of file svm.cpp. References LearnModel::_n_in, SVM::reset_model(), and LearnModel::set_dimensions(). |
|
Reimplemented from LearnModel. Definition at line 201 of file svm.cpp. References LearnModel::_n_in, Object::create(), Object::NIL_ID, SVM::reset_model(), SVM::set_kernel(), and UNSERIALIZE_PARENT. |
|
Definition at line 383 of file svm.cpp. References EPSILON, SVM::n_support_vectors(), SVM::support_vector(), and SVM::support_vector_coef(). Referenced by SVM::margin_norm(). |