maddin79 / darch

Create deep architectures in the R programming language
GNU General Public License v3.0
71 stars 31 forks source link

Error in train.default(x, y, weights = w, ...) : Stopping #22

Closed Lan131 closed 6 years ago

Lan131 commented 8 years ago

Hello, This might be the wrong place for this question. My errors is

Error in train.default(x, y, weights = w, ...) : Stopping In addition: There were 50 or more warnings (use warnings() to see the first 50)

All I did was modify your regression example and combine it with your tuning example, I have bolded the code I changed:

`train=read.csv("path") trainIndex <- createDataPartition(train[,1], p = .7, list = FALSE, times = 1) DataTrain <- train[ trainIndex,] DataTest <- train[-trainIndex,]

tc <- trainControl(method = "boot", number = 5, allowParallel = T, verboseIter = T)

parameters <- data.frame(parameter = c("layers", "bp.learnRate", "darch.unitFunction"), class = c("character", "numeric", "character"), label = c("Network structure", "Learning rate", "unitFunction"))

grid <- function(x, y, len = NULL, search = "grid") { df <- expand.grid(layers = c("c(0,20,0)","c(0,10,10,0)","c(0,10,5,5,0)"), bp.learnRate = c(1,2,5,10))

df[["darch.unitFunction"]] <- rep(c("c(tanhUnit, linearUnit)", "c(tanhUnit, tanhUnit, linearUnit)", "c(tanhUnit, tanhUnit, tanhUnit, linearUnit)"), 4)

df }

darch <- train(Target ~ ., data = DataTrain, tuneLength = 12, trControl = tc, preProc.targets = T, method = darchModelInfo(parameters, grid), preProc = c("center", "scale"), darch.isClass=F, darch.numEpochs = 15, darch.batchSize = 30, xvalid=DataTest[,3: (ncol(DataTest)-1)],yvalid=DataTest[,2])

data is 200 rows

``

Lan131 commented 8 years ago

I can confirm that I am using the correct version of darch.

saviola777 commented 8 years ago

I assume you closed this accidentally, or is your problem fixed? I will look into this when I find time, pretty busy atm, sorry.

saviola777 commented 6 years ago

I'm not sure if the caret train function supports regression optimization at the moment. The main problem here was that you passed darch.isClass which is not allowed since it was set internally according to the caret parameter classProbs. I have disabled this for now, but I will need to run more tests to see if the regression generally works with caret.