aboutsummaryrefslogtreecommitdiff
path: root/src/msvmmaj_sv.c
diff options
context:
space:
mode:
authorGertjan van den Burg <burg@ese.eur.nl>2014-08-25 14:38:03 +0200
committerGertjan van den Burg <burg@ese.eur.nl>2014-08-25 14:38:03 +0200
commit1e340d509f229120eb3aaa98c91028dc3c0d3305 (patch)
treedd6b65c428447f179133e967eb0e0d3ce15f68ec /src/msvmmaj_sv.c
parentfree some work arrays (diff)
downloadgensvm-1e340d509f229120eb3aaa98c91028dc3c0d3305.tar.gz
gensvm-1e340d509f229120eb3aaa98c91028dc3c0d3305.zip
rename msvmmaj to gensvm
Diffstat (limited to 'src/msvmmaj_sv.c')
-rw-r--r--src/msvmmaj_sv.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/msvmmaj_sv.c b/src/msvmmaj_sv.c
deleted file mode 100644
index 1358d4e..0000000
--- a/src/msvmmaj_sv.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file msvmmaj_sv.c
- * @author Gertjan van den Burg
- * @date May, 2014
- * @brief Calculate the number of support vectors
- *
- * @details
- * The function in this file can be used to calculate the number of support
- * vectors are left in a model.
- *
- */
-
-#include "msvmmaj.h"
-#include "msvmmaj_matrix.h"
-
-/**
- * @brief Calculate the number of support vectors in a model
- *
- * @details
- * If an object is correctly classified, the number of classes for which the
- * error q is larger than 1, is K-1 (i.e., there is no error w.r.t. any of the
- * other classes). All objects for which this is not the case are thus support
- * vectors.
- *
- * @param[in] model MajModel with solution
- * @param[in] data MajData to be used
- * @return number of support vectors with this solution
- *
- */
-long msvmmaj_num_sv(struct MajModel *model, struct MajData *data)
-{
- long i, j, num_correct, num_sv = 0;
- double value;
-
- for (i=0; i<data->n; i++) {
- num_correct = 0;
- for (j=0; j<data->K; j++) {
- value = matrix_get(model->Q, data->K, i, j);
- num_correct += (value > 1);
- }
- num_sv += (num_correct < data->K - 1);
- }
-
- return num_sv;
-}