nnet

Caret: There were missing values in resampled performance measures

﹥>﹥吖頭↗ 提交于 2020-04-08 18:28:34
问题 I am running caret's neural network on the Bike Sharing dataset and I get the following error message: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, : There were missing values in resampled performance measures. I am not sure what the problem is. Can anyone help please? The dataset is from: https://archive.ics.uci.edu/ml/datasets/bike+sharing+dataset Here is the coding: library(caret) library(bestNormalize) data_hour = read.csv("hour.csv") # Split dataset set.seed(3)

Multinomial classification using neuralnet package

我的梦境 提交于 2020-01-12 08:43:32
问题 This question ought to be real simple. But the documentation isn't helping. I am using R. I must use the neuralnet package for a multinomial classification problem. All examples are for binomial or linear output. I could do some one-vs-all implementation using binomial output. But I believe I should be able to do this by having 3 units as the output layer, where each is a binomial (ie. probability of that being the correct output). No? This is what I would using nnet (which I believe is doing

Caret on R spills “unable to find variable ”optimismBoot“” error message

徘徊边缘 提交于 2019-12-24 03:23:39
问题 I have been testing caret on R to test neural network features. As I run the script below, it was working correctly, this has been starting outputting "unable to find variable "optimismBoot". library(doParallel) cl <- makePSOCKcluster(4) registerDoParallel(cl) library(caret) m<-rbind(c(1,2,3),c(4,5,6),c(7,8,9)) train_data<-as.data.frame(m) nnmodel <- train( V3 ~ ., data = train_data, method = "nnet", preProcess = c('center', 'scale'), trControl = trainControl(method = "cv"), tuneGrid = expand

Understanding multinomial nnet

拈花ヽ惹草 提交于 2019-12-23 12:18:31
问题 I am trying to understand the code behind nnet . I am currently getting different results when I split a multinomial factor in to the binary columns instead of using the formula method. library(nnet) set.seed(123) y <- class.ind(iris$Species) x <- as.matrix(iris[,1:4]) fit1 <- nnet(x, y, size = 3, decay = .1) # weights: 27 #initial value 164.236516 #iter 10 value 102.567531 #iter 20 value 58.229722 #iter 30 value 39.720137 #iter 40 value 25.049530 #iter 50 value 23.671837 #iter 60 value 23

Problems trying to install package in R

假如想象 提交于 2019-12-11 11:10:35
问题 I am having problems trying to install the nnet package in R. The download seems to be ok, but when I load the library it states namespace ‘nnet’ is imported by ‘car’, ‘effects’ so cannot be unloaded In addition: Warning message: package ‘nnet’ was built under R version 3.2.5 Error in library(nnet) : Package ‘nnet’ version 7.3.11 cannot be unloaded I tried reading other topics which suggest using remove.packages on car and effects. However I tried this and I am still unable to install Thanks

Multinom with Matrix of Counts as Response

落爺英雄遲暮 提交于 2019-12-05 18:41:42
According to the help of multinom , package nnet , "The response should be a factor or a matrix with K columns, which will be interpreted as counts for each of K classes." I tried to use this function in the second case, obtaining an error. Here is a sample code of what I do: response <- matrix(round(runif(200,0,1)*100),ncol=20) # 10x20 matrix of counts predictor <- runif(10,0,1) fit1 <- multinom(response ~ predictor) weights1 <- predict(fit1, newdata = 0.5, "probs") Here what I obtain: 'newdata' had 1 row but variables found have 10 rows How can I solve this problem? Bonus question: I also

Multinomial classification using neuralnet package

微笑、不失礼 提交于 2019-12-03 16:37:58
This question ought to be real simple. But the documentation isn't helping. I am using R. I must use the neuralnet package for a multinomial classification problem. All examples are for binomial or linear output. I could do some one-vs-all implementation using binomial output. But I believe I should be able to do this by having 3 units as the output layer, where each is a binomial (ie. probability of that being the correct output). No? This is what I would using nnet (which I believe is doing what I want): data(iris) library(nnet) m1 <- nnet(Species ~ ., iris, size = 3) table(predict(m1, iris,

stock price prediction by using nnet

北慕城南 提交于 2019-12-02 16:31:55
问题 stock<-structure(list(week = c(1L, 2L, 5L, 2L, 3L, 4L, 3L, 2L, 1L, 5L, 1L, 3L, 2L, 4L, 3L, 4L, 2L, 3L, 1L, 4L, 3L), close_price = c(774000L, 852000L, 906000L, 870000L, 1049000L, 941000L, 876000L, 874000L, 909000L, 966000L, 977000L, 950000L, 990000L, 948000L, 1079000L, NA, 913000L, 932000L, 1020000L, 872000L, 916000L), vol = c(669L, 872L, 3115L, 2693L, 575L, 619L, 646L, 1760L, 419L, 587L, 8922L, 366L, 764L, 6628L, 1116L, NA, 572L, 592L, 971L, 1181L, 1148L), obv = c(1344430L, 1304600L, 1325188L

stock price prediction by using nnet

[亡魂溺海] 提交于 2019-12-02 09:28:31
stock<-structure(list(week = c(1L, 2L, 5L, 2L, 3L, 4L, 3L, 2L, 1L, 5L, 1L, 3L, 2L, 4L, 3L, 4L, 2L, 3L, 1L, 4L, 3L), close_price = c(774000L, 852000L, 906000L, 870000L, 1049000L, 941000L, 876000L, 874000L, 909000L, 966000L, 977000L, 950000L, 990000L, 948000L, 1079000L, NA, 913000L, 932000L, 1020000L, 872000L, 916000L), vol = c(669L, 872L, 3115L, 2693L, 575L, 619L, 646L, 1760L, 419L, 587L, 8922L, 366L, 764L, 6628L, 1116L, NA, 572L, 592L, 971L, 1181L, 1148L), obv = c(1344430L, 1304600L, 1325188L, 1322764L, 1365797L, 1355525L, 1308385L, 1308738L, 1353999L, 1364475L, 1326557L, 1357572L, 1362492L,