54 long folds,
long n_total)
58 double performance, total_perf = 0;
65 for (f=0; f<folds; f++) {
77 predy =
Calloc(
long, test_folds[f]->n);
80 total_perf += performance * test_folds[f]->
n;
85 total_perf /= ((double) n_total);
#define Calloc(type, size)
void gensvm_optimize(struct GenModel *model, struct GenData *data)
The main training loop for GenSVM.
double gensvm_prediction_perf(struct GenData *data, long *perdy)
Calculate the predictive performance (percentage correct)
A structure to represent the data.
void gensvm_initialize_weights(struct GenData *data, struct GenModel *model)
Initialize instance weights.
A structure to represent a single GenSVM model.
FILE * GENSVM_OUTPUT_FILE
void gensvm_predict_labels(struct GenData *testdata, struct GenModel *model, long *predy)
Predict class labels of data given and output in predy.
void gensvm_reallocate_model(struct GenModel *model, long n, long m)
Reallocate memory for GenModel.
long n
number of instances
Header file for gensvm_cross_validation.c.
double gensvm_cross_validation(struct GenModel *model, struct GenData **train_folds, struct GenData **test_folds, long folds, long n_total)
Run cross validation with a given set of train/test folds.