From ff13b0a8552d203b7baeadc8a345a1b6781bc8fe Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 19 May 2014 17:39:04 -0700 Subject: realloc existing model instead of using fold model, saving memory and time! --- include/msvmmaj.h | 5 ++++- include/msvmmaj_train_dataset.h | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/msvmmaj.h b/include/msvmmaj.h index d67ad8b..4e00654 100644 --- a/include/msvmmaj.h +++ b/include/msvmmaj.h @@ -42,7 +42,10 @@ * @param kerneltype kernel to be used in the model * @param kernelparam pointer to the vector of kernel parameters * @param use_cholesky whether the Cholesky decomposition should be - * used + * used + * + * @TODO + * change R to int, it's a binary matrix * */ struct MajModel { diff --git a/include/msvmmaj_train_dataset.h b/include/msvmmaj_train_dataset.h index 5248b4a..4ee39bf 100644 --- a/include/msvmmaj_train_dataset.h +++ b/include/msvmmaj_train_dataset.h @@ -129,9 +129,12 @@ void free_queue(struct Queue *q); void consistency_repeats(struct Queue *q, long repeats, TrainType traintype); -double cross_validation(struct MajModel *model, struct MajModel *seed_model, - struct MajData *data, long folds); +double cross_validation(struct MajModel *model, struct MajData *data, + long folds); void make_model_from_task(struct Task *task, struct MajModel *model); void copy_model(struct MajModel *from, struct MajModel *to); + +void msvmmaj_reallocate_model(struct MajModel *model, long n); + #endif -- cgit v1.2.3