diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-04-04 15:08:12 -0400 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-04-04 15:08:12 -0400 |
| commit | 459ce96fa8a0072d3533bc2dc1566cc1b797401b (patch) | |
| tree | 229a5d9b137f7fcf3b5112e4a189e972d6dafa26 /R/gensvm.grid.R | |
| parent | Ensure classes isn't a factor (diff) | |
| download | rgensvm-459ce96fa8a0072d3533bc2dc1566cc1b797401b.tar.gz rgensvm-459ce96fa8a0072d3533bc2dc1566cc1b797401b.zip | |
Documentation improvements
Diffstat (limited to 'R/gensvm.grid.R')
| -rw-r--r-- | R/gensvm.grid.R | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/R/gensvm.grid.R b/R/gensvm.grid.R index 7be065b..755d650 100644 --- a/R/gensvm.grid.R +++ b/R/gensvm.grid.R @@ -362,11 +362,29 @@ gensvm.load.small.grid <- function() } -#' Generate a vector of cross-validation indices +#' @title Generate a vector of cross-validation indices #' +#' @description #' This function generates a vector of length \code{n} with values from 0 to #' \code{folds-1} to mark train and test splits. #' +#' @param n the number of instances +#' @param folds the number of cross validation folds +#' +#' @return an array of length \code{n} with values in the range [0, folds-1] +#' indicating the test fold of each instance. +#' +#' @author +#' Gerrit J.J. van den Burg, Patrick J.F. Groenen \cr +#' Maintainer: Gerrit J.J. van den Burg <gertjanvandenburg@gmail.com> +#' +#' @references +#' Van den Burg, G.J.J. and Groenen, P.J.F. (2016). \emph{GenSVM: A Generalized +#' Multiclass Support Vector Machine}, Journal of Machine Learning Research, +#' 17(225):1--42. URL \url{http://jmlr.org/papers/v17/14-526.html}. +#' +#' @seealso +#' \code{\link{gensvm.grid}} gensvm.generate.cv.idx <- function(n, folds) { cv.idx <- matrix(0, n, 1) @@ -572,13 +590,14 @@ gensvm.expand.param.grid <- function(pg, n.features) #' @title Compute the ranks for the numbers in a given vector #' -#' @details -#' This function computes the ranks for the values in an array. The highest -#' value gets the smallest rank. Ties are broken by assigning the smallest -#' value. +#' @description This function computes the ranks for the values in an array. +#' The highest value gets the smallest rank. Ties are broken by assigning the +#' smallest value. The smallest rank is 1. #' #' @param x array of numeric values #' +#' @return array with the ranks of the values in the input array. +#' gensvm.rank.score <- function(x) { x <- as.array(x) |
