Go to the source code of this file.
Functions | |
| void | DoSvmNormalize (Dataset *dataset) |
| Data Normalization. | |
| void | GenerateArtificialDataset (Dataset *dataset) |
| Generate an artificial data set. | |
| int | LoadData (Dataset *dataset, String datafilename) |
| Load data set from data file. | |
| int | main (int argc, char *argv[]) |
| Multiclass SVM classification/ SVM regression - Main function. | |
Variables | |
| const fx_module_doc | svm_main_doc |
| const fx_entry_doc | svm_main_entries_doc [] |
This file contains main routines for performing 0. multiclass SVM classification (one-vs-one method is employed). 1. SVM regression (epsilon-insensitive loss i.e. epsilon-SVR). 2. one-class SVM (TODO)
It provides four modes: "cv": cross validation; "train": model training "train_test": training and then online batch testing; "test": offline batch testing.
Please refer to README for detail description of usage and examples.
Definition in file svm_main.cc.
| void DoSvmNormalize | ( | Dataset * | dataset | ) |
Data Normalization.
| the dataset to be normalized |
Definition at line 99 of file svm_main.cc.
References linalg__private::AddTo(), GenVector< T >::CopyValues(), fx_default_param(), fx_param_bool(), GenVector< T >::Init(), GenMatrix< T >::Init(), GenVector< T >::length(), Dataset::matrix(), linalg__private::MulInit(), linalg__private::MulTransBInit(), Dataset::n_features(), Dataset::n_points(), linalg__private::Scale(), la::ScaleRows(), GenVector< T >::SetZero(), la::TransposeInit(), and Dataset::WriteCsv().
Referenced by LoadData().
| void GenerateArtificialDataset | ( | Dataset * | dataset | ) |
Generate an artificial data set.
| the dataset to be generated |
Definition at line 165 of file svm_main.cc.
References fx_param_double(), fx_param_int(), Dataset::OwnMatrix(), and data::Save().
Referenced by LoadData().
Load data set from data file.
If data file not exists, generate an artificial data set.
| the dataset | ||
| name of the data file to be loaded |
Definition at line 211 of file svm_main.cc.
References DoSvmNormalize(), fx_param_bool(), fx_param_exists(), fx_param_str_req(), GenerateArtificialDataset(), and Dataset::InitFromFile().
Referenced by main().
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Multiclass SVM classification/ SVM regression - Main function.
| argc | ||
| argv |
Definition at line 240 of file svm_main.cc.
References SVM< TKernel >::BatchPredict(), fx_done(), fx_param_int_req(), fx_param_str_req(), fx_root, fx_submodule(), SVM< TKernel >::Init(), GeneralCrossValidator< TLearner >::Init(), SVM< TKernel >::InitTrain(), LoadData(), SVM< TKernel >::LoadModelBatchPredict(), and GeneralCrossValidator< TLearner >::Run().
| const fx_module_doc svm_main_doc |
{
svm_main_entries_doc, NULL,
"These are the implementations for Support Vector Machines (SVM), including Multiclass classification, Regression, and One Class SVM)\n"
}
Definition at line 89 of file svm_main.cc.
1.6.3