Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding conformal extensions to right-censored data #22

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
99eb0ca
Extensions to right-censored data
ariane-cwi Sep 21, 2023
b5a59ca
Name repository
ariane-cwi Sep 21, 2023
1a54547
Minor revisions
ariane-cwi Sep 21, 2023
f08789c
Update README.md
ariane-cwi Sep 21, 2023
8dee1eb
Update check.R
ariane-cwi Sep 21, 2023
51132f1
Merge branch 'master' of https://github.com/ariane-cwi/conformal
ariane-cwi Sep 21, 2023
c82f8c5
Test check
ariane-cwi Sep 21, 2023
52b84f4
Test check
ariane-cwi Sep 21, 2023
b21e20d
Export
ariane-cwi Sep 25, 2023
ee645a3
Namespace modification
ariane-cwi Sep 25, 2023
b699baa
Description modifications
ariane-cwi Sep 25, 2023
fba01a8
Namespace update
ariane-cwi Sep 25, 2023
31220cf
Update rmst.pred.R
ariane-cwi Sep 25, 2023
85fe8f4
Update rmst.pred.Rd
ariane-cwi Sep 25, 2023
f62e90e
Description updates
ariane-cwi Sep 25, 2023
e2ca674
rmst.pred update
ariane-cwi Sep 25, 2023
e03c9a0
rmst.pred updates
ariane-cwi Sep 25, 2023
c567c52
rmst.pred updates
ariane-cwi Sep 25, 2023
145cd25
Description updates
ariane-cwi Sep 25, 2023
7c8e403
Description updates
ariane-cwi Sep 25, 2023
439422f
Update loco.roo.R
ariane-cwi Sep 25, 2023
68f98b8
Update loco.roo.R
ariane-cwi Sep 25, 2023
d7b26a9
Dimension issue
ariane-cwi Sep 26, 2023
f241bf5
Dimension issues
ariane-cwi Sep 26, 2023
07e88de
Independent function wrss
ariane-cwi Sep 26, 2023
a20f168
wrss updates
ariane-cwi Sep 26, 2023
e0cfeb2
wrss updates
ariane-cwi Sep 26, 2023
b76bf34
wrss updates
ariane-cwi Sep 26, 2023
d244393
wrss error
ariane-cwi Sep 26, 2023
fceea8c
Update rmst.pred.R
ariane-cwi Sep 26, 2023
eedfcad
Illustrations
ariane-cwi Sep 27, 2023
626829a
Update fig.loco.surv.R
ariane-cwi Sep 27, 2023
247e1eb
Update fig.loco.surv.R
ariane-cwi Sep 27, 2023
2219209
Alpha check error
ariane-cwi Sep 28, 2023
7f2e864
Update plot.rmst.pred
ariane-cwi Sep 28, 2023
d74667c
Correction wrss
ariane-cwi Nov 8, 2023
68c2103
varsL and varsG
ariane-cwi Dec 13, 2023
a7ad4bb
Update plot.rmst.pred for vimpL
ariane-cwi Dec 13, 2023
ee4e11d
Update rmst.pred.R
ariane-cwi Dec 13, 2023
354747e
Update rmst.pred.R
ariane-cwi Dec 19, 2023
89b1f43
Update check.R
ariane-cwi Dec 20, 2023
61bfd6a
Update check.R
ariane-cwi Dec 20, 2023
5099094
Update check.R
ariane-cwi Dec 20, 2023
c719088
Update check.R
ariane-cwi Dec 20, 2023
3eedb4d
Factors authorized in x
ariane-cwi Jan 5, 2024
89c80bc
Update ipcw.R
ariane-cwi Jan 9, 2024
0425f10
Rejection rate
ariane-cwi Feb 12, 2024
df79528
Update fig.loco.surv.R
ariane-cwi Aug 20, 2024
5dd268f
Update rmst.pred.R
ariane-cwi Aug 20, 2024
d694302
Update roo.R
ariane-cwi Aug 21, 2024
ac93512
Update split.R
ariane-cwi Aug 21, 2024
53218da
Update ipcw.R
ariane-cwi Aug 23, 2024
0124d3d
Update ipcw.R
ariane-cwi Aug 23, 2024
a4c3fe9
Update ipcw.R
ariane-cwi Aug 23, 2024
51bde67
Update loco.R
ariane-cwi Sep 6, 2024
092ecc2
Update loco.R
ariane-cwi Sep 10, 2024
800bd54
Update ipcw.R
ariane-cwi Sep 24, 2024
1a55b09
Update calibration.pdf
ariane-cwi Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Factors authorized in x
ariane-cwi committed Jan 5, 2024
commit 3eedb4d8f27a5298b71685f4e0eeba003d379141
25 changes: 19 additions & 6 deletions conformalInference/R/check.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
check.args = function(x=NULL, y=NULL, x0=NULL, alpha=NULL,
train.fun=NULL, predict.fun=NULL, mad.train.fun=NULL, mad.predict.fun=NULL,
special.fun=NULL) {
train.fun=NULL, predict.fun=NULL, mad.train.fun=NULL, mad.predict.fun=NULL,
special.fun=NULL) {

if (is.null(x) || !is.numeric(x)) stop("x must be a numeric matrix")
if (is.null(y) || !is.numeric(y)) stop("y must be a numeric vector")
@@ -26,22 +26,35 @@ check.args = function(x=NULL, y=NULL, x0=NULL, alpha=NULL,
check.args.surv = function(x=NULL, t=NULL, d=NULL, tau=NULL, x0=NULL, w=NULL,
cens.model=NULL, alpha=NULL, train.fun=NULL, predict.fun=NULL,
mad.train.fun=NULL, mad.predict.fun=NULL, special.fun=NULL) {

if (is.null(x) || !is.numeric(x)) stop("x must be a numeric matrix")
if (is.null(x)) stop("x must be a matrix")
if (is.null(t) || !is.numeric(t)) stop("t must be a numeric vector")
if (nrow(x) != length(t)) stop("nrow(x) and length(t) must match")
if (is.null(d) || !is.numeric(d)) stop("d must be a binary (0/1) vector")
if (length(d[d!=0 & d!=1]) != 0) stop("d must be a binary (0/1) vector")
if (length(d) != length(t)) stop("length(d) and length(t) must match")
if (is.null(x0)) stop("x0 must be a matrix")
if (ncol(x) != ncol(x0)) stop("ncol(x) and ncol(x0) must match")
if (!is.null(w) && !is.numeric(w)) stop("w must be NULL or a numeric vector")
if (!is.null(w) && length(w) != length(t))
stop("length(w) and length(t) must match")
if (!(cens.model %in% c("km","rsf","cox")))
stop("cens.model must be km, rsf or cox")
check.pos.num(tau)
check.num.01(alpha)
check.args(x, t, x0, alpha, train.fun,
predict.fun, mad.train.fun, mad.predict.fun, special.fun)
if (is.null(train.fun) || !is.function(train.fun))
stop("train.fun must be a function")
if (is.null(predict.fun) || !is.function(predict.fun))
stop("predict.fun must be a function")
if (!is.null(mad.train.fun) && !is.function(mad.train.fun))
stop("mad.train.fun must be a function")
if (!is.null(mad.predict.fun) && !is.function(mad.predict.fun))
stop("mad.predict.fun must be a function")
if ((!is.null(mad.train.fun) && is.null(mad.predict.fun)) ||
(is.null(mad.train.fun) && !is.null(mad.predict.fun)))
stop("mad.train.fun and mad.predict.fun must both be provided")
if (!is.null(special.fun) && !is.function(special.fun))
stop("special.fun must be a function")
}

check.bool = function(b) {
36 changes: 18 additions & 18 deletions conformalInference/R/loco.R
Original file line number Diff line number Diff line change
@@ -70,8 +70,8 @@
#' @export loco

loco = function(x, y, train.fun, predict.fun, active.fun, alpha=0.1,
bonf.correct=TRUE, split=NULL, seed=NULL, verbose=FALSE) {

bonf.correct=TRUE, split=NULL, seed=NULL, verbose=FALSE) {
# Set up data
x = as.matrix(x)
y = as.numeric(y)
@@ -81,7 +81,7 @@ loco = function(x, y, train.fun, predict.fun, active.fun, alpha=0.1,
# Check input arguments
check.args(x=x,y=y,x0=x,alpha=alpha,train.fun=train.fun,
predict.fun=predict.fun)

# Users may pass in a string for the verbose argument
if (verbose == TRUE) txt = ""
if (verbose != TRUE && verbose != FALSE) {
@@ -120,24 +120,24 @@ loco = function(x, y, train.fun, predict.fun, active.fun, alpha=0.1,
# Get residuals on second
res = abs(y[i2] - matrix(predict.fun(out,x[i2,,drop=F]),nrow=n2))
res.drop = vector(mode="list",length=J)

# Re-fit after dropping each feature in the master list
for (j in Seq(1,J)) {
if (verbose) {
cat(sprintf(paste("\r%sRe-fitting after dropping feature %i (%i of %i",
"considered) ..."),txt,master[j],j,J))
flush.console()
}

# Train on the first part, without variable
out.j = train.fun(x[i1,-master[j],drop=F],y[i1])

# Get predictions on the other, without variable
res.drop[[j]] = abs(y[i2] - matrix(predict.fun(out.j,x[i2,-master[j],
drop=F]),nrow=n2))
drop=F]),nrow=n2))
}
if (verbose) cat("\n")

# Compute p-values and confidence intervals at each tuning step
inf.z = inf.sign = inf.wilcox = vector(mode="list",length=m)

@@ -150,7 +150,7 @@ loco = function(x, y, train.fun, predict.fun, active.fun, alpha=0.1,
}
else cat(sprintf("%sPerforming LOCO analysis ...",txt))
}

k = length(active[[l]])
inf.z[[l]] = inf.sign[[l]] = inf.wilcox[[l]] = matrix(0,k,3)
for (j in Seq(1,k)) {
@@ -167,9 +167,9 @@ loco = function(x, y, train.fun, predict.fun, active.fun, alpha=0.1,
colnames(inf.wilcox[[l]]) = c("P-value", "LowConfPt", "UpConfPt")
}
if (verbose) cat("\n")

out = list(inf.z=inf.z,inf.sign=inf.sign,inf.wilcox=inf.wilcox,
active=active, master=master, bonf.correct=bonf.correct)
active=active, master=master, bonf.correct=bonf.correct)
class(out) = "loco"
return(out)
}
@@ -191,7 +191,7 @@ loco = function(x, y, train.fun, predict.fun, active.fun, alpha=0.1,

print.loco = function(x, test=c("wilcox","sign","z","all"), digits=3, ...) {
test = match.arg(test)

cat(paste("\nDisplaying results of LOCO analysis. Notes:\n",
"\n- P-values are from a one-sided test of the target parameter",
"\n (mean or median excess test error) being equal to zero versus",
@@ -229,15 +229,15 @@ print.loco = function(x, test=c("wilcox","sign","z","all"), digits=3, ...) {

if (test=="wilcox" || test=="all") {
cat("\nWilcoxon test results:\n\n")
tab = round(x$inf.wilcox[[i]],digits=digits)
tab = round(x$inf.wilcox[[i]],digits=digits)
code = get.signif.code(x$inf.wilcox[[i]][,1])
tab = cbind(rownames(tab),tab,code)
colnames(tab)[1] = "Var"
colnames(tab)[5] = ""
rownames(tab) = rep("",nrow(tab))
print(tab,quote=FALSE)
}

cat("\nSignificance codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n")
}
}
@@ -248,7 +248,7 @@ my.z.test = function(z, alpha, k, bonf.correct=TRUE){
s = sd(z)
m = mean(z)
pval = 1-pnorm(m/s*sqrt(n))

# Apply Bonferroni correction for k tests
if (bonf.correct) {
pval = min(k*pval,1)
@@ -266,7 +266,7 @@ my.sign.test = function(z, alpha, k, bonf.correct=TRUE){
n = length(z)
s = sum(z>0)
pval = 1-pbinom(s-1,n,0.5)

# Apply Bonferroni correction for k tests
if (bonf.correct) {
pval = min(k*pval,1)
@@ -283,7 +283,7 @@ my.sign.test = function(z, alpha, k, bonf.correct=TRUE){
# Median inference: one-sided p-value but a two-sided confidence interval
my.wilcox.test = function(z, alpha, k, bonf.correct=TRUE){
pval = wilcox.test(z, alternative="greater", exact=TRUE)$p.value

# Apply Bonferroni correction for k tests
if (bonf.correct) {
pval = min(k*pval,1)
@@ -381,7 +381,7 @@ loco.surv = function(x, t, d, tau, train.fun, predict.fun, w=NULL,
seed=NULL, verbose=FALSE) {

# Set up data
x = as.matrix(x)
# x = as.matrix(x)
t = as.numeric(t)
d = as.numeric(d)
if(!is.null(w)) w = as.numeric(w)
34 changes: 17 additions & 17 deletions conformalInference/R/loco.roo.R
Original file line number Diff line number Diff line change
@@ -74,9 +74,9 @@
#' @export loco.roo

loco.roo = function(x, y, train.fun, predict.fun, vars=0,
alpha=0.1, mad.train.fun=NULL, mad.predict.fun=NULL, split=NULL,
seed=NULL, out.roo=NULL, verbose=FALSE) {

alpha=0.1, mad.train.fun=NULL, mad.predict.fun=NULL, split=NULL,
seed=NULL, out.roo=NULL, verbose=FALSE) {
# Set up data
x = as.matrix(x)
y = as.numeric(y)
@@ -94,7 +94,7 @@ loco.roo = function(x, y, train.fun, predict.fun, vars=0,
txt = verbose
verbose = TRUE
}

inds = vector(mode="list",length=2)

# Compute in-sample rank-one-out intervals ourselves
@@ -103,15 +103,15 @@ loco.roo = function(x, y, train.fun, predict.fun, vars=0,
if (!is.null(split)) inds[[1]] = split
# Otherwise make a random split
else inds[[1]] = sample(1:n,floor(n/2))

if (verbose) {
cat(sprintf(paste("%sComputing in-sample rank-one-out conformal",
"prediction intervals ...\n"),txt))
}

out.roo = conformal.pred.roo(x,y,train.fun,predict.fun,alpha=alpha,
mad.train.fun=mad.train.fun,mad.predict.fun=mad.predict.fun,
split=inds[[1]],verbose=ifelse(verbose,paste0(txt,"\t"),FALSE))
mad.train.fun=mad.train.fun,mad.predict.fun=mad.predict.fun,
split=inds[[1]],verbose=ifelse(verbose,paste0(txt,"\t"),FALSE))
}
# These have already been computed
else {
@@ -123,7 +123,7 @@ loco.roo = function(x, y, train.fun, predict.fun, vars=0,
}
inds[[1]] = out.roo$split
}

inds[[2]] = (1:n)[-inds[[1]]]
pred = out.roo$pred
m = ncol(pred)
@@ -144,7 +144,7 @@ loco.roo = function(x, y, train.fun, predict.fun, vars=0,
for (k in 1:2) {
i1 = inds[[k]]; n1 = length(i1)
i2 = inds[[3-k]]; n2 = length(i2)

cat(sprintf("%sHandling %s part of the data-split ...\n",
txt,ifelse(k==1,"first","second")))

@@ -154,23 +154,23 @@ loco.roo = function(x, y, train.fun, predict.fun, vars=0,
txt,vars[j],j,nv))
flush.console()
}

# Train on the first part, without variable
out.j = train.fun(x[i1,-vars[j],drop=F],y[i1])

# Get predictions on the other, without variable
pred.j = matrix(predict.fun(out.j,x[i2,-vars[j],drop=F]),nrow=n2)

# Get the conformal intervals for differences in the residuals
a = conformal.diff.int(pred[i2,,drop=F],pred.j,
out.roo$lo[i2,,drop=F],out.roo$up[i2,,drop=F])
out.roo$lo[i2,,drop=F],out.roo$up[i2,,drop=F])
lo[i2,j,] = a$lo
up[i2,j,] = a$up
}

if (verbose) cat("\n")
}

return(list(lo=lo,up=up,vars=vars,split=inds[[1]],out.roo=out.roo))
}

@@ -180,12 +180,12 @@ conformal.diff.int = function(mu1, mu2, lo, up) {
n = nrow(mu1)
m = ncol(mu1)
v.lo = v.up = matrix(0,n,m)

# Cases where mu1 is larger
oo = mu2 <= mu1
v.lo[oo] = trunc(lo,mu2,mu1)[oo]
v.up[oo] = trunc(up,mu2,mu1)[oo]

# Cases where mu2 is larger
oo = mu1 <= mu2
v.lo[oo] = -trunc(up,mu1,mu2)[oo]
@@ -284,7 +284,7 @@ loco.roo.surv = function(x, t, d, tau, train.fun, predict.fun, w=NULL,
split=NULL, seed=NULL, out.roo.surv=NULL, verbose=FALSE) {

# Set up data
x = as.matrix(x)
# x = as.matrix(x)
t = as.numeric(t)
d = as.numeric(d)
if(!is.null(w)) w = as.numeric(w)
28 changes: 14 additions & 14 deletions conformalInference/R/rmst.pred.R
Original file line number Diff line number Diff line change
@@ -114,13 +114,13 @@
#' @export rmst.pred

rmst.pred = function(x, t, d, tau, train.fun, predict.fun, w=NULL,
cens.model="km", CV=T, n.folds=10, prop=0.1, active.fun=NULL, alpha=0.1,
rho=0.5, varsL=0, varsG=0, bonf.correct=FALSE, mad.train.fun=NULL,
mad.predict.fun=NULL, split=NULL, seed=NULL, out.roo.surv=NULL, verbose=FALSE,
error=T,roo=T,vimpL=T,vimpG=T) {

cens.model="km", CV=T, n.folds=10, prop=0.1, active.fun=NULL, alpha=0.1,
rho=0.5, varsL=0, varsG=0, bonf.correct=FALSE, mad.train.fun=NULL,
mad.predict.fun=NULL, split=NULL, seed=NULL, out.roo.surv=NULL, verbose=FALSE,
error=T,roo=T,vimpL=T,vimpG=T) {
# Set up data
x = as.matrix(x)
# x = as.matrix(x)
t = as.numeric(t)
d = as.numeric(d)
if(!is.null(w)) w = as.numeric(w)
@@ -196,7 +196,7 @@ rmst.pred = function(x, t, d, tau, train.fun, predict.fun, w=NULL,
cat(sprintf(paste("%sComputing local variable importance ...\n"),txt))
}
out.loco.roo.surv = loco.roo.surv(x, t, d, tau, train.fun, predict.fun,
vars=varsL, alpha=alpha, out.roo.surv=out.roo.surv, verbose=F)
vars=varsL, alpha=alpha, out.roo.surv=out.roo.surv, verbose=F)
out$out.loco.roo.surv=out.loco.roo.surv
out$m = ncol(out.loco.roo.surv$out.roo.surv$pred)
}
@@ -213,7 +213,7 @@ rmst.pred = function(x, t, d, tau, train.fun, predict.fun, w=NULL,
out$m = length(out.loco.surv$active)
}


class(out) = "rmst.pred"
return(out)
}
@@ -260,8 +260,8 @@ print.rmst.pred = function(x,elements=c("all"),digits=3,
"\n Mean and quantiles are computed and displayed as follows:",
"\n Mean [0.1-quantile, 0.9-quantile]\n"))
mse.disp = paste(round(apply(x$mse,2,mean),digits=digits),"[",
round(apply(x$mse,2,function(s)quantile(s,0.1)),digits=digits),",",
round(apply(x$mse,2,function(s)quantile(s,0.9)),digits=digits),"]")
round(apply(x$mse,2,function(s)quantile(s,0.1)),digits=digits),",",
round(apply(x$mse,2,function(s)quantile(s,0.9)),digits=digits),"]")
}
}

@@ -278,8 +278,8 @@ print.rmst.pred = function(x,elements=c("all"),digits=3,
"\n Mean [0.1-quantile, 0.9-quantile]\n")

d.disp = paste(round(apply(d,2,mean),digits=digits),"[",
round(apply(d,2,function(s)quantile(s,0.1)),digits=digits),",",
round(apply(d,2,function(s)quantile(s,0.9)),digits=digits),"]")
round(apply(d,2,function(s)quantile(s,0.1)),digits=digits),",",
round(apply(d,2,function(s)quantile(s,0.9)),digits=digits),"]")
}
}

@@ -377,7 +377,7 @@ plot.rmst.pred = function(x,elements=c("all"), model.names=NULL, ...) {
for (i in 1:m){
for (j in 1:length(varsL)){
plot(x$x[,varsL[j]],x$x[,varsL[j]],ylim=range(c(x$out.loco.roo.surv$lo,
x$out.loco.roo.surv$up)),xlab="Location",ylab="Interval",
x$out.loco.roo.surv$up)),xlab="Location",ylab="Interval",
main=paste(model.names[i], "- Var.",varsL[j]),col=NA)
cols = ifelse(x$out.loco.roo.surv$lo[,j,i] <= 0, 1, 3)
segments(x$x[,varsL[j]],x$out.loco.roo.surv$lo[,j,i],
@@ -405,7 +405,7 @@ plot.rmst.pred = function(x,elements=c("all"), model.names=NULL, ...) {
1:p, x$out.loco.surv$inf.sign[[i]][,3],
col="red", lwd=2)
points(1:p,(x$out.loco.surv$inf.sign[[i]][,3]+x$out.loco.surv$inf.sign[[i]][,2])/2,
col="red",pch=23)
col="red",pch=23)
}
}

22 changes: 11 additions & 11 deletions conformalInference/R/roo.R
Original file line number Diff line number Diff line change
@@ -82,9 +82,9 @@
#' @export conformal.pred.roo

conformal.pred.roo = function(x, y, train.fun, predict.fun, alpha=0.1,
mad.train.fun=NULL, mad.predict.fun=NULL, split=NULL, seed=NULL,
verbose=FALSE) {

mad.train.fun=NULL, mad.predict.fun=NULL, split=NULL, seed=NULL,
verbose=FALSE) {
# Set up data
x = as.matrix(x)
y = as.numeric(y)
@@ -95,7 +95,7 @@ conformal.pred.roo = function(x, y, train.fun, predict.fun, alpha=0.1,
check.args(x=x,y=y,x0=x,alpha=alpha,train.fun=train.fun,
predict.fun=predict.fun,mad.train.fun=mad.train.fun,
mad.predict.fun=mad.predict.fun)

# Users may pass in a string for the verbose argument
if (verbose == TRUE) txt = ""
if (verbose != TRUE && verbose != FALSE) {
@@ -125,24 +125,24 @@ conformal.pred.roo = function(x, y, train.fun, predict.fun, alpha=0.1,
cat(sprintf("%sSplitting data into parts of size %i and %i ...\n",txt,
floor(n/2),ceiling(n/2)))
}

# Train one split, and get residuals on the other
for (k in 1:2) {
i1 = inds[[k]]; n1 = length(i1)
i2 = inds[[3-k]]; n2 = length(i2)

if (verbose) {
cat(sprintf("%sTraining on %s part ...\n",txt,
ifelse(k==1,"first","second")))
}

# Train on first part
out = train.fun(x[i1,,drop=F],y[i1])
yhat1 = matrix(predict.fun(out,x[i1,,drop=F]),nrow=n1)
yhat2 = matrix(predict.fun(out,x[i2,,drop=F]),nrow=n2)
fit[i1,] = yhat1
pred[i2,] = yhat2

if (verbose) {
cat(sprintf("%sComputing residuals and quantiles on %s part ...\n",
txt,ifelse(k==1,"first","second")))
@@ -259,11 +259,11 @@ conformal.pred.roo = function(x, y, train.fun, predict.fun, alpha=0.1,


conformal.pred.roo.surv = function(x, t, d, tau, train.fun, predict.fun,
w=NULL,cens.model="km", alpha=0.1, mad.train.fun=NULL, mad.predict.fun=NULL,
split=NULL, seed=NULL, verbose=FALSE) {
w=NULL,cens.model="km", alpha=0.1, mad.train.fun=NULL, mad.predict.fun=NULL,
split=NULL, seed=NULL, verbose=FALSE) {

# Set up data
x = as.matrix(x)
# x = as.matrix(x)
t = as.numeric(t)
d = as.numeric(d)
if(!is.null(w)) w = as.numeric(w)
2 changes: 1 addition & 1 deletion conformalInference/R/split.R
Original file line number Diff line number Diff line change
@@ -249,7 +249,7 @@ conformal.pred.split.surv = function(x, t, d, tau, x0, train.fun, predict.fun,
mad.predict.fun=NULL, split=NULL, seed=NULL, verbose=FALSE) {

# Set up data
x = as.matrix(x)
# x = as.matrix(x)
t = as.numeric(t)
d = as.numeric(d)
if(!is.null(w)) w = as.numeric(w)