51 long i, j, k,
n,
K, label;
52 double norm, min_dist,
61 ZV =
Calloc(
double, n*(K-1));
75 for (k=0; k<K-1; k++) {
79 norm = cblas_dnrm2(K-1, S, 1);
80 if (norm < min_dist) {
110 for (i=0; i<data->
n; i++)
111 if (data->
y[i] == predy[i])
114 performance = ((double) correct)/((double) data->
n)* 100.0;
#define Calloc(type, size)
long K
number of classes for the workspace
void gensvm_predict_labels(struct GenData *testdata, struct GenModel *model, long *predy)
Predict class labels of data given and output in predy.
Header file for gensvm_predict.c.
void gensvm_simplex(struct GenModel *model)
Generate matrix of simplex vertex coordinates.
#define matrix_get(M, cols, i, j)
double * ZV
n x (K-1) working matrix for the Z * V calculation
long * y
array of class labels, 1..K
A structure to represent the data.
A structure to represent a single GenSVM model.
void gensvm_calculate_ZV(struct GenModel *model, struct GenData *data, double *ZV)
Wrapper around sparse/dense versions of this function.
double gensvm_prediction_perf(struct GenData *data, long *predy)
Calculate the predictive performance (percentage correct)
long K
number of classes in the dataset
long n
number of instances
long n
number of instances for the workspace