aboutsummaryrefslogtreecommitdiff
path: root/R/predict.gensvm.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/predict.gensvm.R')
-rw-r--r--R/predict.gensvm.R5
1 files changed, 3 insertions, 2 deletions
diff --git a/R/predict.gensvm.R b/R/predict.gensvm.R
index d7540f6..133b40e 100644
--- a/R/predict.gensvm.R
+++ b/R/predict.gensvm.R
@@ -54,7 +54,7 @@ predict.gensvm <- function(fit, x.test, ...)
if (ncol(x.test) != fit$n.features) {
cat("Error: Number of features of fitted model and testing",
"data disagree.\n")
- return
+ return(NULL)
}
x.train <- fit$X.train
@@ -62,11 +62,12 @@ predict.gensvm <- function(fit, x.test, ...)
cat("Error: The training data is needed to compute predictions for ",
"nonlinear GenSVM. This data is not present in the fitted ",
"model!\n", sep="")
+ return(NULL)
}
if (!is.null(x.train) && ncol(x.train) != fit$n.features) {
cat("Error: Number of features of fitted model and training",
"data disagree.\n")
- return
+ return(NULL)
}
if (fit$kernel == 'linear') {