aboutsummaryrefslogtreecommitdiff
path: root/src/gensvm_crossval.c
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2016-05-09 20:55:24 +0200
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2016-05-09 20:55:24 +0200
commit7c8a5e4b2a7cff7573b1a308daf19d2dbd558a9c (patch)
tree2c4774a63ec91d60931d822a7607a5011711c946 /src/gensvm_crossval.c
parentadd doc and test to phony (diff)
downloadgensvm-7c8a5e4b2a7cff7573b1a308daf19d2dbd558a9c.tar.gz
gensvm-7c8a5e4b2a7cff7573b1a308daf19d2dbd558a9c.zip
strip whitespaces
Diffstat (limited to 'src/gensvm_crossval.c')
-rw-r--r--src/gensvm_crossval.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gensvm_crossval.c b/src/gensvm_crossval.c
index 864e692..6930166 100644
--- a/src/gensvm_crossval.c
+++ b/src/gensvm_crossval.c
@@ -1,13 +1,13 @@
/**
* @file crossval.c
- * @author Gertjan van den Burg
+ * @author Gertjan van den Burg
* @date January 7, 2014
* @brief Functions for cross validation
*
* @details
* This file contains functions for performing cross validation. The funtion
* gensvm_make_cv_split() creates a cross validation vector for non-stratified
- * cross validation. The function gensvm_get_tt_split() creates a train and
+ * cross validation. The function gensvm_get_tt_split() creates a train and
* test dataset from a given dataset and a pre-determined CV partition vector.
* See individual function documentation for details.
*
@@ -22,17 +22,17 @@
*
* @details
* A pre-allocated vector of length N is created which can be used to define
- * cross validation splits. The folds are contain between
- * @f$ \lfloor N / folds \rfloor @f$ and @f$ \lceil N / folds \rceil @f$
- * instances. An instance is mapped to a partition randomly until all folds
- * contain @f$ N \% folds @f$ instances. The zero fold then contains
+ * cross validation splits. The folds are contain between
+ * @f$ \lfloor N / folds \rfloor @f$ and @f$ \lceil N / folds \rceil @f$
+ * instances. An instance is mapped to a partition randomly until all folds
+ * contain @f$ N \% folds @f$ instances. The zero fold then contains
* @f$ N / folds + N \% folds @f$ instances. These remaining @f$ N \% folds @f$
- * instances are then distributed over the first @f$ N \% folds @f$ folds.
+ * instances are then distributed over the first @f$ N \% folds @f$ folds.
*
* @param[in] N number of instances
* @param[in] folds number of folds
* @param[in,out] cv_idx array of size N which contains the fold index
- * for each observation on exit
+ * for each observation on exit
*
*/
void gensvm_make_cv_split(long N, long folds, long *cv_idx)
@@ -44,7 +44,7 @@ void gensvm_make_cv_split(long N, long folds, long *cv_idx)
long big_folds = N%folds;
long small_fold_size = N/folds;
-
+
j = 0;
for (i=0; i<small_fold_size*folds; i++)
while (1) {
@@ -73,9 +73,9 @@ void gensvm_make_cv_split(long N, long folds, long *cv_idx)
* @details
* Given a GenData structure for the full dataset, a previously created
* cross validation split vector and a fold index, a training and test dataset
- * are created.
+ * are created.
*
- * @param[in] full_data a GenData structure for the entire
+ * @param[in] full_data a GenData structure for the entire
* dataset
* @param[in,out] train_data an initialized GenData structure which
* on exit contains the training dataset
@@ -83,7 +83,7 @@ void gensvm_make_cv_split(long N, long folds, long *cv_idx)
* on exit contains the test dataset
* @param[in] cv_idx a vector of cv partitions created by
* gensvm_make_cv_split()
- * @param[in] fold_idx index of the fold which becomes the
+ * @param[in] fold_idx index of the fold which becomes the
* test dataset
*/
void gensvm_get_tt_split(struct GenData *full_data, struct GenData *train_data,