[0aeb11]: / pamr.train.R

Download this file

24 lines (18 with data), 544 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pamr.train <-
function (data, n.threshold = 30, offset.percent = 50, remove.zeros = TRUE)
{
this.call <- match.call()
if (!is.null(data$y)) {
problem.type <- "class"
}
y <- as.factor(data$y)
ytest <- NULL
xtest <- NULL
prior <- table(y)/length(y)
junk <- nsc(data$x, y = y, offset.percent = offset.percent, n.threshold = n.threshold, prior = prior,
remove.zeros = remove.zeros)
junk$call <- this.call
junk$problem.type <- problem.type
class(junk) = "pamrtrained"
junk
}