GenSVM
|
Main functions for predicting class labels.. More...
#include "gensvm_predict.h"
Go to the source code of this file.
Functions | |
void | gensvm_predict_labels (struct GenData *testdata, struct GenModel *model, long *predy) |
Predict class labels of data given and output in predy. More... | |
double | gensvm_prediction_perf (struct GenData *data, long *predy) |
Calculate the predictive performance (percentage correct) More... | |
Main functions for predicting class labels..
This file contains functions for predicting the class labels of instances and a function for calculating the predictive performance (hitrate) of a prediction given true class labels.
This file is part of GenSVM.
GenSVM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
GenSVM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GenSVM. If not, see http://www.gnu.org/licenses/.
Definition in file gensvm_predict.c.
Predict class labels of data given and output in predy.
The labels are predicted by mapping each instance in data to the simplex space using the matrix V in the given model. Next, for each instance the nearest simplex vertex is determined using an Euclidean norm. The nearest simplex vertex determines the predicted class label, which is recorded in predy.
[in] | testdata | GenData to predict labels for |
[in] | model | GenModel with optimized V |
[out] | predy | pre-allocated vector to record predictions in |
Definition at line 48 of file gensvm_predict.c.
double gensvm_prediction_perf | ( | struct GenData * | data, |
long * | predy | ||
) |
Calculate the predictive performance (percentage correct)
The predictive performance is calculated by simply counting the number of correctly classified samples and dividing by the total number of samples, multiplying by 100.
[in] | data | the GenData dataset with known labels |
[in] | predy | the predicted class labels |
Definition at line 105 of file gensvm_predict.c.