Running ‘test1.R’
  Running ‘test2.R’
  Running ‘test3.R’
Running the tests in ‘tests/test1.R’ failed.
Complete output:
  > # Example 1: Using the nn object trained by neuralnet package
  > set.seed(500)
  > library(MASS)
  > data <- Boston
  > maxs <- apply(data, 2, max)
  > mins <- apply(data, 2, min)
  > scaled <- as.data.frame(scale(data, center = mins, scale = maxs - mins)) # normalization
  > index <- sample(1:nrow(data),round(0.75*nrow(data)))
  > train_ <- scaled[index,]
  > test_ <- scaled[-index,]
  > 
  > library(neuralnet) # Training
  > n <- names(train_)
  > f <- as.formula(paste("medv ~", paste(n[!n %in% "medv"], collapse = " + ")))
  > nn <- neuralnet(f,data = train_,hidden = c(5,3),linear.output = FALSE)
  > plot(nn)
  > 
  > library(nnetpredint) # Getting Prediction confidence interval
  > x <- train_[,-14]
  > y <- train_[,14]
  > newData <- test_[,-14]
  > 
  > # S3 generic method: Object of nn
  > yPredInt <- nnetPredInt(nn, x, y, newData)
  Error in (class(xTrain) %in% c("matrix", "data.frame")) && (class(yTrain) %in%  : 
    'length = 2' in coercion to 'logical(1)'
  Calls: nnetPredInt -> nnetPredInt.nn -> getPredInt -> checkInput
  Execution halted
Running the tests in ‘tests/test2.R’ failed.
Complete output:
  > # Example 2: Using the nnet object trained by nnet package
  > library(nnet)
  > xTrain <- rbind(cbind(runif(150,min = 0, max = 0.5),runif(150,min = 0, max = 0.5)) ,
  + 		cbind(runif(150,min = 0.5, max = 1),runif(150,min = 0.5, max = 1))
  + 		)
  > nObs <- dim(xTrain)[1]
  > yTrain <- 0.5 + 0.4 * sin(2* pi * xTrain %*% c(0.4,0.6)) +rnorm(nObs,mean = 0, sd = 0.05)
  > plot(xTrain %*% c(0.4,0.6),yTrain)
  > 
  > # Training nnet models
  > net <- nnet(yTrain ~ xTrain,size = 3, rang = 0.1,decay = 5e-4, maxit = 500)
  # weights:  13
  initial  value 35.259828 
  iter  10 value 9.646561
  iter  20 value 4.728526
  iter  30 value 3.779644
  iter  40 value 2.472166
  iter  50 value 2.382817
  iter  60 value 2.246882
  iter  70 value 2.189990
  iter  80 value 1.727944
  iter  90 value 1.622836
  iter 100 value 1.609302
  iter 110 value 1.595428
  iter 120 value 1.529652
  iter 130 value 1.418099
  iter 140 value 1.084052
  iter 150 value 0.951194
  iter 160 value 0.935696
  iter 170 value 0.925880
  iter 180 value 0.924930
  iter 190 value 0.924115
  iter 200 value 0.923442
  iter 210 value 0.923399
  iter 220 value 0.923311
  iter 230 value 0.923292
  iter 240 value 0.923289
  iter 250 value 0.923280
  final  value 0.923280 
  converged
  > yFit <- c(net$fitted.values)
  > nodeNum <- c(2,3,1)
  > wts <- net$wts
  > 
  > # New data for prediction intervals
  > library(nnetpredint)
  > newData <- cbind(seq(0,1,0.05),seq(0,1,0.05))
  > yTest <- 0.5 + 0.4 * sin(2* pi * newData %*% c(0.4,0.6))+rnorm(dim(newData)[1],mean = 0, sd = 0.05)
  > 
  > # S3 generic method: Object of nnet
  > yPredInt <- nnetPredInt(net, xTrain, yTrain, newData)
  Error in (class(xTrain) %in% c("matrix", "data.frame")) && (class(yTrain) %in%  : 
    'length = 2' in coercion to 'logical(1)'
  Calls: nnetPredInt -> nnetPredInt.nnet -> getPredInt -> checkInput
  Execution halted
Running the tests in ‘tests/test3.R’ failed.
Complete output:
  > # Example 3: Using the rsnns object trained by RSNNS package
  > library(RSNNS)
  Loading required package: Rcpp
  > data(iris)
  > #shuffle the vector
  > iris <- iris[sample(1:nrow(iris),length(1:nrow(iris))),1:ncol(iris)]
  > irisValues <- iris[,1:4]
  > irisTargets <- decodeClassLabels(iris[,5])[,'setosa']
  > 
  > iris <- splitForTrainingAndTest(irisValues, irisTargets, ratio=0.15)
  > iris <- normTrainingAndTestSet(iris)
  > model <- mlp(iris$inputsTrain, iris$targetsTrain, size=5, learnFuncParams=c(0.1),
  + 	maxit=50, inputsTest=iris$inputsTest, targetsTest=iris$targetsTest)
  > predictions <- predict(model,iris$inputsTest)
  > 
  > 
  > # Generating prediction intervals
  > library(nnetpredint)
  > 
  > # S3 Method for rsnns class prediction intervals
  > xTrain <- iris$inputsTrain
  > yTrain <- iris$targetsTrain
  > newData <- iris$inputsTest
  > yPredInt <- nnetPredInt(model, xTrain, yTrain, newData)
  Error in (class(xTrain) %in% c("matrix", "data.frame")) && (class(yTrain) %in%  : 
    'length = 2' in coercion to 'logical(1)'
  Calls: nnetPredInt -> nnetPredInt.rsnns -> getPredInt -> checkInput
  Execution halted