n = 1000
x = matrix(rnorm(n*2),n,2)
c = 1+3*x[,1]
y = rbinom(n,1,1/(1+exp(-c)))
#fit = nproc(x, y, method = 'svm')
#fit2 = nproc(x, y, method = 'svm', cv = TRUE)
fit3 = nproc(x, y, method = 'penlog')
#fit3 = nproc(x, y, method = 'penlog', n.cores = 2)
#In practice, replace 2 by the number of cores available 'detectCores()'
#fit4 = nproc(x, y, method = 'penlog', n.cores = detectCores())
#Testing the custom method for nproc.
#fit = npc(x, y, method = 'lda', split = FALSE, n.cores = 2) #use npc to get score list.
#obj = nproc(x = NULL, y = fit$y, method = 'custom', split = FALSE,
#score = fit$score, n.cores = 2)
Run the code above in your browser using DataLab