aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2018-03-27 13:57:25 +0100
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2018-03-27 13:57:25 +0100
commit50b52b707ea3d02a26b42554a424c3983f16aa58 (patch)
tree625e0ac415a5e88743255f5b2a5e956f78dc169b /R
parentupdate submodule (diff)
downloadrgensvm-50b52b707ea3d02a26b42554a424c3983f16aa58.tar.gz
rgensvm-50b52b707ea3d02a26b42554a424c3983f16aa58.zip
fix examples after testing them all
Diffstat (limited to 'R')
-rw-r--r--R/gensvm.grid.R5
-rw-r--r--R/gensvm.maxabs.scale.R1
-rw-r--r--R/gensvm.refit.R2
-rw-r--r--R/plot.gensvm.R6
4 files changed, 4 insertions, 10 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,