diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-03-27 13:57:25 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-03-27 13:57:25 +0100 |
| commit | 50b52b707ea3d02a26b42554a424c3983f16aa58 (patch) | |
| tree | 625e0ac415a5e88743255f5b2a5e956f78dc169b | |
| parent | update submodule (diff) | |
| download | rgensvm-50b52b707ea3d02a26b42554a424c3983f16aa58.tar.gz rgensvm-50b52b707ea3d02a26b42554a424c3983f16aa58.zip | |
fix examples after testing them all
| -rw-r--r-- | R/gensvm.grid.R | 5 | ||||
| -rw-r--r-- | R/gensvm.maxabs.scale.R | 1 | ||||
| -rw-r--r-- | R/gensvm.refit.R | 2 | ||||
| -rw-r--r-- | R/plot.gensvm.R | 6 | ||||
| -rw-r--r-- | man/gensvm.maxabs.scale.Rd | 1 | ||||
| -rw-r--r-- | man/gensvm.rank.score.Rd | 6 | ||||
| -rw-r--r-- | man/gensvm.refit.Rd | 2 | ||||
| -rw-r--r-- | man/plot.gensvm.Rd | 6 |
8 files changed, 8 insertions, 21 deletions
diff --git a/R/gensvm.grid.R b/R/gensvm.grid.R index 5d27fde..2b90e57 100644 --- a/R/gensvm.grid.R +++ b/R/gensvm.grid.R @@ -592,11 +592,6 @@ gensvm.expand.param.grid <- function(pg, n.features) #' #' @param x array of numeric values #' -#' @examples -#' x <- c(7, 0.1, 0.5, 0.1, 10, 100, 200) -#' gensvm.rank.score(x) -#' [ 4 6 5 6 3 2 1 ] -#' gensvm.rank.score <- function(x) { x <- as.array(x) diff --git a/R/gensvm.maxabs.scale.R b/R/gensvm.maxabs.scale.R index 6ac351b..42b0be2 100644 --- a/R/gensvm.maxabs.scale.R +++ b/R/gensvm.maxabs.scale.R @@ -44,7 +44,6 @@ #' apply(x.scale, 2, max) #' #' # with a train and test dataset -#' x <- iris[, -5] #' split <- gensvm.train.test.split(x) #' x.train <- split$x.train #' x.test <- split$x.test diff --git a/R/gensvm.refit.R b/R/gensvm.refit.R index a6af3fd..fab7579 100644 --- a/R/gensvm.refit.R +++ b/R/gensvm.refit.R @@ -31,7 +31,7 @@ #' #' # fit a standard model and refit with slightly different parameters #' fit <- gensvm(x, y) -#' fit2 <- gensvm.refit(x, y, epsilon=1e-8) +#' fit2 <- gensvm.refit(fit, x, y, epsilon=1e-8) #' #' # refit a model returned by a grid search #' grid <- gensvm.grid(x, y) diff --git a/R/plot.gensvm.R b/R/plot.gensvm.R index 0ce215b..85ff3b5 100644 --- a/R/plot.gensvm.R +++ b/R/plot.gensvm.R @@ -46,9 +46,9 @@ #' #' # plot only misclassified samples #' x.mis <- x[predict(fit, x) != y, ] -#' y.mis.true <- y[predict(fit, x) != y, ] -#' plot(fit, x.bad) -#' plot(fit, x.bad, y.true=y.mis.true) +#' y.mis.true <- y[predict(fit, x) != y] +#' plot(fit, x.mis) +#' plot(fit, x.mis, y.true=y.mis.true) #' plot.gensvm <- function(fit, x, y.true=NULL, with.margins=TRUE, with.shading=TRUE, with.legend=TRUE, center.plot=TRUE, diff --git a/man/gensvm.maxabs.scale.Rd b/man/gensvm.maxabs.scale.Rd index 50c6413..0bb09ba 100644 --- a/man/gensvm.maxabs.scale.Rd +++ b/man/gensvm.maxabs.scale.Rd @@ -43,7 +43,6 @@ apply(x.scale, 2, min) apply(x.scale, 2, max) # with a train and test dataset -x <- iris[, -5] split <- gensvm.train.test.split(x) x.train <- split$x.train x.test <- split$x.test diff --git a/man/gensvm.rank.score.Rd b/man/gensvm.rank.score.Rd index 21d6bcd..3c1549d 100644 --- a/man/gensvm.rank.score.Rd +++ b/man/gensvm.rank.score.Rd @@ -14,10 +14,4 @@ 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. } -\examples{ -x <- c(7, 0.1, 0.5, 0.1, 10, 100, 200) -gensvm.rank.score(x) -[ 4 6 5 6 3 2 1 ] - -} diff --git a/man/gensvm.refit.Rd b/man/gensvm.refit.Rd index 194cde3..18803af 100644 --- a/man/gensvm.refit.Rd +++ b/man/gensvm.refit.Rd @@ -28,7 +28,7 @@ y <- iris[, 5] # fit a standard model and refit with slightly different parameters fit <- gensvm(x, y) -fit2 <- gensvm.refit(x, y, epsilon=1e-8) +fit2 <- gensvm.refit(fit, x, y, epsilon=1e-8) # refit a model returned by a grid search grid <- gensvm.grid(x, y) diff --git a/man/plot.gensvm.Rd b/man/plot.gensvm.Rd index b597e18..e28a108 100644 --- a/man/plot.gensvm.Rd +++ b/man/plot.gensvm.Rd @@ -51,9 +51,9 @@ plot(fit, x, y.true=y) # plot only misclassified samples x.mis <- x[predict(fit, x) != y, ] -y.mis.true <- y[predict(fit, x) != y, ] -plot(fit, x.bad) -plot(fit, x.bad, y.true=y.mis.true) +y.mis.true <- y[predict(fit, x) != y] +plot(fit, x.mis) +plot(fit, x.mis, y.true=y.mis.true) } \author{ |
