blob: 5876448352c528f4e0872d54935686bebaf63f90 (
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
92
93
94
95
96
|
/**
* @file gensvm_grid.h
* @author G.J.J. van den Burg
* @date 2016-05-01
* @brief Header file for gensvm_grid.c
*
* @details
* The grid search for the optimal parameters is done through a queue.
* This file contains struct definitions for this queue and a single
* task in a queue, as well as a structure for the complete training
* scheme. Function declarations 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_GRID_H
#define GENSVM_GRID_H
#include "gensvm_globals.h"
/**
* @brief Structure for describing the entire grid search
*
* @param traintype type of training to use
* @param kerneltype type of kernel to use throughout training
* @param repeats number of repeats to be done after the grid
* search to find the parameter set with the
* most consistent high performance
* @param folds number of folds in cross validation
* @param Np size of the array of p values
* @param Nl size of the array of lambda values
* @param Nk size of the array of kappa values
* @param Ne size of the array of epsilon values
* @param Nw size of the array of weight_idx values
* @param Ng size of the array of gamma values
* @param Nc size of the array of coef values
* @param Nd size of the array of degree values
* @param *weight_idxs array of weight_idxs
* @param *ps array of p values
* @param *lambdas array of lambda values
* @param *kappas array of kappa values
* @param *epsilons array of epsilon values
* @param *gammas array of gamma values
* @param *coefs array of coef values
* @param *degrees array of degree values
* @param *train_data_file filename of train data file
* @param *test_data_file filename of test data file
*
*/
struct GenGrid {
TrainType traintype;
KernelType kerneltype;
long repeats;
long folds;
long Np;
long Nl;
long Nk;
long Ne;
long Nw;
long Ng;
long Nc;
long Nd;
int *weight_idxs;
double *ps;
double *lambdas;
double *kappas;
double *epsilons;
double *gammas;
double *coefs;
double *degrees;
char *train_data_file;
char *test_data_file;
};
// function declarations
struct GenGrid *gensvm_init_grid();
void gensvm_free_grid(struct GenGrid *grid);
#endif
|