aboutsummaryrefslogtreecommitdiff
path: root/include/gensvm_task.h
blob: a79126248f88eb5c2c0826f839f0880765703b24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
 * @file gensvm_task.h
 * @author G.J.J. van den Burg
 * @date 2013-08-01
 * @brief Header file for gensvm_task.c
 *
 * @details
 * The grid search for the optimal parameters is done through a queue.
 * This file contains struct definitions for the tasks in the queue.
 * Initialization and free functions are also included.
 *
 * @copyright
 Copyright 2016, G.J.J. van den Burg.

 This file is part of GenSVM.

 GenSVM 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 3 of the License, or
 (at your option) any later version.

 GenSVM 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 GenSVM. If not, see <http://www.gnu.org/licenses/>.

 */

#ifndef GENSVM_TASK_H
#define GENSVM_TASK_H

#include "gensvm_base.h"

/**
 * @brief A structure for a single task in the queue.
 *
 * @param folds 	number of folds in cross validation
 * @param ID 		numeric id of the task in the queue
 * @param weight_idx 	parameter for the GenModel
 * @param p 		parameter for the GenModel
 * @param kappa 	parameter for the GenModel
 * @param lambda 	parameter for the GenModel
 * @param epsilon 	parameter for the GenModel
 * @param kerneltype 	parameter for the GenModel
 * @param gamma 	parameter for the GenModel
 * @param coef 		parameter for the GenModel
 * @param degree 	parameter for the GenModel
 * @param train_data 	pointer to the training data
 * @param test_data 	pointer to the test data (if any)
 * @param performance 	performance after cross validation
 */
struct GenTask {
	KernelType kerneltype;
	///< kerneltype parameter for the GenModel
	int weight_idx;
	///< weight_idx parameter for the GenModel
	long folds;
	///< number of folds in cross validation
	long ID;
	///< numeric id of the task in the queue
	double p;
	///< p parameter for the GenModel
	double kappa;
	///< kappa parameter for the GenModel
	double lambda;
	///< lambda parameter for the GenModel
	double epsilon;
	///< epsilon parameter for the GenModel
	double gamma;
	///< gamma parameter for the GenModel
	double coef;
	///< coef parameter for the GenModel
	double degree;
	///< degree parameter for the GenModel
	struct GenData *train_data;
	///< pointer to the training data
	struct GenData *test_data;
	///< pointer to the test data (if any)
	double performance;
	///< performance after cross validation
};

struct GenTask *gensvm_init_task();
struct GenTask *gensvm_copy_task(struct GenTask *t);
void gensvm_free_task(struct GenTask *t);
void gensvm_task_to_model(struct GenTask *task, struct GenModel *model);

#endif