Error: nrow(x) == n is not TRUE when using Train in Caret

后端 未结 2 1362
死守一世寂寞
死守一世寂寞 2021-01-18 01:51

I have a training set that looks like

Name       Day         Area         X    Y    Month Night
ATTACK    Monday   LA           -122.41 37.78   8      0
VEHI         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-18 02:16

    Even though in the help file of train said either maxtrix or data frame would be expected, but you can try to convert the matrix to a data frame:

    model <- train(y=ynn, x=as.data.frame(mnn), method='nnet',linout=TRUE, trace = FALSE, trControl = nnTrControl,metric="logLoss", tuneGrid=nnGrid)
    

提交回复
热议问题