diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-04-05 15:35:57 -0400 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-04-05 15:35:57 -0400 |
| commit | 2224f89c05a5540102101b1310e120c12d533028 (patch) | |
| tree | bb5ea2d6f826cade03aa697e17f7f03d300cc475 /R | |
| parent | fix type of ZV matrix (diff) | |
| download | rgensvm-2224f89c05a5540102101b1310e120c12d533028.tar.gz rgensvm-2224f89c05a5540102101b1310e120c12d533028.zip | |
don't run a bunch of examples to make check faster
Diffstat (limited to 'R')
| -rw-r--r-- | R/coef.gensvm.grid.R | 2 | ||||
| -rw-r--r-- | R/gensvm.R | 4 | ||||
| -rw-r--r-- | R/gensvm.grid.R | 4 | ||||
| -rw-r--r-- | R/gensvm.refit.R | 2 | ||||
| -rw-r--r-- | R/plot.gensvm.grid.R | 2 | ||||
| -rw-r--r-- | R/predict.gensvm.grid.R | 2 | ||||
| -rw-r--r-- | R/print.gensvm.grid.R | 2 |
7 files changed, 16 insertions, 2 deletions
diff --git a/R/coef.gensvm.grid.R b/R/coef.gensvm.grid.R index 48b2a76..f9908ba 100644 --- a/R/coef.gensvm.grid.R +++ b/R/coef.gensvm.grid.R @@ -26,11 +26,13 @@ #' @importFrom stats coef #' #' @examples +#' \dontrun{ #' x <- iris[, -5] #' y <- iris[, 5] #' #' grid <- gensvm.grid(x, y) #' pg <- coef(grid) +#' } #' coef.gensvm.grid <- function(object, ...) { @@ -107,8 +107,8 @@ #' fit <- gensvm(x, y, max.iter=1000) #' #' # Nonlinear training -#' fit <- gensvm(x, y, kernel='rbf', max.iter=5000) -#' fit <- gensvm(x, y, kernel='poly', degree=2, gamma=1.0, max.iter=5000) +#' fit <- gensvm(x, y, kernel='rbf', max.iter=1000) +#' fit <- gensvm(x, y, kernel='poly', degree=2, gamma=1.0, max.iter=1000) #' #' # Setting the random seed and comparing results #' fit <- gensvm(x, y, random.seed=123) diff --git a/R/gensvm.grid.R b/R/gensvm.grid.R index 2bf673e..8fa187e 100644 --- a/R/gensvm.grid.R +++ b/R/gensvm.grid.R @@ -130,8 +130,10 @@ #' x <- iris[, -5] #' y <- iris[, 5] #' +#' \dontrun{ #' # use the default parameter grid #' grid <- gensvm.grid(x, y, verbose=TRUE) +#' } #' #' # use a smaller parameter grid #' pg <- expand.grid(p=c(1.0, 1.5, 2.0), kappa=c(-0.9, 1.0), epsilon=c(1e-3)) @@ -140,6 +142,7 @@ #' # print the result #' print(grid) #' +#' \dontrun{ #' # Using a custom scoring function (accuracy as percentage) #' acc.pct <- function(yt, yp) { return (100 * sum(yt == yp) / length(yt)) } #' grid <- gensvm.grid(x, y, scoring=acc.pct) @@ -148,6 +151,7 @@ #' pg <- expand.grid(kernel=c('rbf'), gamma=c(1e-2, 1e-1, 1, 1e1, 1e2), #' lambda=c(1e-8, 1e-6), max.iter=c(5000)) #' grid <- gensvm.grid(x, y, param.grid=pg, verbose=2) +#' } #' gensvm.grid <- function(x, y, param.grid='tiny', refit=TRUE, scoring=NULL, cv=3, verbose=0, return.train.score=TRUE) diff --git a/R/gensvm.refit.R b/R/gensvm.refit.R index f3b818b..54040f4 100644 --- a/R/gensvm.refit.R +++ b/R/gensvm.refit.R @@ -60,9 +60,11 @@ #' fit <- gensvm(x, y) #' fit2 <- gensvm.refit(fit, x, y, epsilon=1e-8) #' +#' \dontrun{ #' # refit a model returned by a grid search #' grid <- gensvm.grid(x, y) #' fit <- gensvm.refit(fit, x, y, epsilon=1e-8) +#' } #' #' # refit on different data #' idx <- runif(nrow(x)) > 0.5 diff --git a/R/plot.gensvm.grid.R b/R/plot.gensvm.grid.R index 6a34024..c755c3c 100644 --- a/R/plot.gensvm.grid.R +++ b/R/plot.gensvm.grid.R @@ -25,11 +25,13 @@ #' @export #' #' @examples +#' \dontrun{ #' x <- iris[, -5] #' y <- iris[, 5] #' #' grid <- gensvm.grid(x, y) #' plot(grid, x) +#' } #' plot.gensvm.grid <- function(x, ...) { diff --git a/R/predict.gensvm.grid.R b/R/predict.gensvm.grid.R index acc838f..d6f5e06 100644 --- a/R/predict.gensvm.grid.R +++ b/R/predict.gensvm.grid.R @@ -35,6 +35,7 @@ #' @importFrom stats predict #' #' @examples +#' \dontrun{ #' x <- iris[, -5] #' y <- iris[, 5] #' @@ -43,6 +44,7 @@ #' #' # predict training sample #' y.hat <- predict(grid, x) +#' } #' predict.gensvm.grid <- function(object, newdata, ...) { diff --git a/R/print.gensvm.grid.R b/R/print.gensvm.grid.R index 3e1bb69..d0755ca 100644 --- a/R/print.gensvm.grid.R +++ b/R/print.gensvm.grid.R @@ -25,12 +25,14 @@ #' @export #' #' @examples +#' \dontrun{ #' x <- iris[, -5] #' y <- iris[, 5] #' #' # fit a grid search and print the resulting object #' grid <- gensvm.grid(x, y) #' print(grid) +#' } #' print.gensvm.grid <- function(x, ...) { |
