Skip to content

Commit

Permalink
Merge ef89803 into 7775682
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwright committed Jan 5, 2018
2 parents 7775682 + ef89803 commit 81911eb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
@@ -1,7 +1,8 @@
Package: survivalsvm
Type: Package
Title: Survival Support Vector Analysis
Version: 0.0.3
Version: 0.0.4
Date: 2018-01-05
Author: Cesaire J. K. Fouodo
Maintainer: Cesaire Fouodo <fouodo@imbs.uni-luebeck.de>
Description: Performs support vectors analysis for data sets with survival
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Expand Up @@ -16,3 +16,4 @@ export(survivalsvm)
export(vanbelle1Fit)
export(vanbelle2Fit)
import(survival)
importFrom(utils,packageVersion)
2 changes: 2 additions & 0 deletions R/predictions.R
Expand Up @@ -37,6 +37,7 @@
#' opt.meth = "quadprog", kernel = "add_kernel")
#' pred.survsvm.reg <- predict(object = survsvm.reg, newdata = veteran, subset = test.index)
#' print(pred.survsvm.reg)
#' @importFrom utils packageVersion
predict.survivalsvm <- function(object, newdata, subset = NULL, ...) {
if (!inherits(object, "survivalsvm")) {
stop("Error: 'object' must be a survivalsvm object.")
Expand Down Expand Up @@ -146,6 +147,7 @@ predict.survivalsvm <- function(object, newdata, subset = NULL, ...) {
if (object$typeofsurvivalsvm == "hybrid") {
result <- predictHybrid(object = object$model.fit, X_pred = X_pred)
}
result$package.version <- unlist(packageVersion("survivalsvm"))
return(result)
}

Expand Down
4 changes: 2 additions & 2 deletions R/prints.R
Expand Up @@ -25,7 +25,7 @@ print.survivalsvm <- function(x, ...) {
result <- printHybrid(object = x)
}
cat("survivalsvm version :",
unlist(packageVersion("survivalsvm")), "\n")
x$package.version, "\n")
}

#' Print of object of class \code{RegFitObj}. \code{RegFitObj} is the class of models fitted using the regression approach of survival support vector machines.
Expand Down Expand Up @@ -146,5 +146,5 @@ print.survivalsvmprediction <- function(x, ...) {
cat("predicted risk ranks :", round(x$predicted[1:min(5,
length(x$predicted))], 2), "...\n")
cat("survivalsvm version :",
unlist(packageVersion("survivalsvm")), "\n")
x$package.version, "\n")
}
2 changes: 2 additions & 0 deletions R/survivalsvm.R
Expand Up @@ -116,6 +116,7 @@
#' Artificial Intelligence in medecine 53, 107-118.
#' }
#' @import survival
#' @importFrom utils packageVersion
survivalsvm <- function (formula = NULL, data = NULL, subset = NULL, type = "regression",
diff.meth = NULL, gamma.mu = NULL, opt.meth = "quadprog", kernel = "lin_kernel",
kernel.pars = NULL, time.variable.name = NULL, status.variable.name = NULL,
Expand Down Expand Up @@ -301,5 +302,6 @@ survivalsvm <- function (formula = NULL, data = NULL, subset = NULL, type = "reg
var.names = covar
)
class(result) <- "survivalsvm"
result$package.version <- unlist(packageVersion("survivalsvm"))
return(result)
}

0 comments on commit 81911eb

Please sign in to comment.