From 459ce96fa8a0072d3533bc2dc1566cc1b797401b Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Apr 2018 15:08:12 -0400 Subject: Documentation improvements --- R/gensvm.grid.R | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'R/gensvm.grid.R') 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 +#' +#' @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) -- cgit v1.2.3