SVM< TKernel > Class Template Reference

Class for SVM. More...

Collaboration diagram for SVM< TKernel >:
[legend]

List of all members.

Public Types

typedef TKernel Kernel

Public Member Functions

void BatchPredict (int learner_typeid, Dataset &testset, String predictedvalue_filename)
 Online batch classification for multiple testing vectors.
void Init (int learner_typeid, const Dataset &dataset, datanode *module)
 SVM initialization.
void InitTrain (int learner_typeid, const Dataset &dataset, datanode *module)
 Initialization(data dependent) and training for SVM learners.
void LoadModelBatchPredict (int learner_typeid, Dataset &testset, String model_filename, String predictedvalue_filename)
 Load models from a file, and perform offline batch classification for multiple testing vectors.
double Predict (int learner_typeid, const Vector &vector)
 SVM prediction for one testing vector.

Detailed Description

template<typename TKernel>
class SVM< TKernel >

Class for SVM.

Definition at line 119 of file svm.h.


Member Function Documentation

template<typename TKernel >
void SVM< TKernel >::BatchPredict ( int  learner_typeid,
Dataset testset,
String  predictedvalue_filename 
) [inline]

Online batch classification for multiple testing vectors.

No need to load model file, since models are already in RAM.

Note: for test set, if no true test labels provided, just put some dummy labels (e.g. all -1) in the last row of testset

Parameters:
 type id of the learner
 testing set
 file name of the testing data

Definition at line 629 of file svm.h.

References Dataset::matrix(), Dataset::n_features(), Dataset::n_points(), and SVM< TKernel >::Predict().

Referenced by SVM< TKernel >::LoadModelBatchPredict(), and main().

template<typename TKernel >
void SVM< TKernel >::Init ( int  learner_typeid,
const Dataset dataset,
datanode module 
) [inline]

SVM initialization.

Parameters:
 labeled training set or testing set
 number of classes (different labels) in the data set
 module name

Definition at line 220 of file svm.h.

References fx_param_double(), fx_param_int(), fx_submodule(), ArrayList< TElem >::Init(), Dataset::n_features(), Dataset::n_labels(), and Dataset::n_points().

Referenced by SVM< TKernel >::InitTrain(), and main().

template<typename TKernel >
void SVM< TKernel >::InitTrain ( int  learner_typeid,
const Dataset dataset,
datanode module 
) [inline]

Initialization(data dependent) and training for SVM learners.

Parameters:
 typeid of the learner
 number of classes (different labels) in the training set
 module name

Definition at line 286 of file svm.h.

References SVM< TKernel >::Init().

Referenced by main().

template<typename TKernel >
void SVM< TKernel >::LoadModelBatchPredict ( int  learner_typeid,
Dataset testset,
String  model_filename,
String  predictedvalue_filename 
) [inline]

Load models from a file, and perform offline batch classification for multiple testing vectors.

Parameters:
 type id of the learner
 testing set
 name of the model file
 name of the file to store classified labels

Definition at line 662 of file svm.h.

References SVM< TKernel >::BatchPredict().

Referenced by main().

template<typename TKernel >
double SVM< TKernel >::Predict ( int  learner_typeid,
const Vector datum 
) [inline]

SVM prediction for one testing vector.

Parameters:
 type id of the learner
 testing vector
Returns:
: predited value

Definition at line 511 of file svm.h.

Referenced by SVM< TKernel >::BatchPredict().


The documentation for this class was generated from the following file:
Generated on Mon Jan 24 12:04:40 2011 for FASTlib by  doxygen 1.6.3