aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGertjan van den Burg <burg@ese.eur.nl>2016-10-17 13:41:46 +0200
committerGertjan van den Burg <burg@ese.eur.nl>2016-10-17 13:41:46 +0200
commite2c0ca1c082bfd7755c7af5bc5c9021bce64f3ba (patch)
tree3564a0b9ed66ccf71d16bf54a304aad320876bbf /include
parentupdate doxyfile (diff)
downloadgensvm-e2c0ca1c082bfd7755c7af5bc5c9021bce64f3ba.tar.gz
gensvm-e2c0ca1c082bfd7755c7af5bc5c9021bce64f3ba.zip
Update predictions to work with sparse matrices
This is done by pulling the Z*V routines from the gensvm_optimize file to a seperate file, since they are shared by prediction and get_loss
Diffstat (limited to 'include')
-rw-r--r--include/gensvm_optimize.h1
-rw-r--r--include/gensvm_pred.h5
-rw-r--r--include/gensvm_zv.h32
3 files changed, 38 insertions, 0 deletions
diff --git a/include/gensvm_optimize.h b/include/gensvm_optimize.h
index 93f6676..39e17b7 100644
--- a/include/gensvm_optimize.h
+++ b/include/gensvm_optimize.h
@@ -16,6 +16,7 @@
#include "gensvm_sv.h"
#include "gensvm_simplex.h"
#include "gensvm_update.h"
+#include "gensvm_zv.h"
// function declarations
void gensvm_optimize(struct GenModel *model, struct GenData *data);
diff --git a/include/gensvm_pred.h b/include/gensvm_pred.h
index 56e16e8..12a59eb 100644
--- a/include/gensvm_pred.h
+++ b/include/gensvm_pred.h
@@ -15,10 +15,15 @@
// includes
#include "gensvm_kernel.h"
#include "gensvm_simplex.h"
+#include "gensvm_zv.h"
// function declarations
void gensvm_predict_labels(struct GenData *testdata,
struct GenModel *model, long *predy);
+void gensvm_predict_labels_dense(struct GenData *testdata,
+ struct GenModel *model, long *predy);
+void gensvm_predict_labels_sparse(struct GenData *testdata,
+ struct GenModel *model, long *predy);
double gensvm_prediction_perf(struct GenData *data, long *perdy);
#endif
diff --git a/include/gensvm_zv.h b/include/gensvm_zv.h
new file mode 100644
index 0000000..1134640
--- /dev/null
+++ b/include/gensvm_zv.h
@@ -0,0 +1,32 @@
+/**
+ * @file gensvm_zv.h
+ * @author Gertjan van den Burg
+ * @date 2016-10-17
+ * @brief Header file for gensvm_zv.c
+
+ * Copyright (C)
+
+ This program 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 2
+ of the License, or (at your option) any later version.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ */
+
+#include "gensvm_base.h"
+
+void gensvm_calculate_ZV(struct GenModel *model, struct GenData *data,
+ double *ZV);
+void gensvm_calculate_ZV_sparse(struct GenModel *model,
+ struct GenData *data, double *ZV);
+void gensvm_calculate_ZV_dense(struct GenModel *model,
+ struct GenData *data, double *ZV);