search for: resmatrix

Displaying 2 results from an estimated 2 matches for "resmatrix".

2004 Mar 30
1
classification with nnet: handling unequal class sizes
...entropy fit if the number of levels is two, and a number of outputs equal to the number of classes and a softmax output stage for more levels. -> therefore two lines of Prof. Ripley's wrapper function are changed below (original commented out) and an additional function has been introduced (resmatrix) con <- function(...) { print(tab <- table(...)) diag(tab) <- 0 cat("error rate = ", round(100*sum(tab)/length(list(...)[[1]]), 2), "%\n") invisible() } CVnn2 <- function(formula, data, size = c(0,4,4,10,10), lambda = c(0,...
2004 Sep 23
0
nnet with weights parameter: odd error
...nd I need your help! I tried it very simple in defining the weights as = 1 for each obs (as it is by default)!: CVnn2 <- function(formula, data, size = c(0,4,4,10,10), lambda = c(0, rep(c(0.001, 0.01),2)), nreps = 1, nifold = 5, verbose = 99, ...) { resmatrix <- function(predict.matrix, learn, data, ri, i) { rae.matrix <- predict.matrix rae.matrix[,] <- 0 rae.vector <- as.numeric(as.factor((predict(learn, data[ri == i,], type = "class")))) fo...