From 527e1e0162a287d11b92be48eb22c5f98d6e59b8 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Tue, 27 Mar 2018 19:31:26 +0100 Subject: Add support for predicting after grid search With this commit the gensvm_grid executable can now compute predictions with the best model found during the grid search. The test dataset is supplied through the training file, and a command line flag is added to support saving the predictions in an output file. --- src/gensvm_consistency.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/gensvm_consistency.c') diff --git a/src/gensvm_consistency.c b/src/gensvm_consistency.c index 07ff7a6..0aa33c0 100644 --- a/src/gensvm_consistency.c +++ b/src/gensvm_consistency.c @@ -124,8 +124,11 @@ struct GenQueue *gensvm_top_queue(struct GenQueue *q, double percentile) * configurations for consistency * @param[in] percentile percentile of performance to determine which * tasks to repeat + * + * @return ID of the best task + * */ -void gensvm_consistency_repeats(struct GenQueue *q, long repeats, +int gensvm_consistency_repeats(struct GenQueue *q, long repeats, double percentile) { bool breakout; @@ -229,11 +232,12 @@ void gensvm_consistency_repeats(struct GenQueue *q, long repeats, "mean_perf\tstd_perf\ttime_perf\n"); p = 0.0; breakout = false; - while (breakout == false) { + int best_id = -1; + while (!breakout) { pi = gensvm_percentile(mean, N, (100.0-p)); pr = gensvm_percentile(std, N, p); pt = gensvm_percentile(time, N, p); - for (i=0; itasks[i]->ID; } + } p += 1.0; } @@ -263,6 +270,8 @@ void gensvm_consistency_repeats(struct GenQueue *q, long repeats, free(std); free(mean); free(time); + + return best_id; } /** -- cgit v1.2.3