我试图预测自住房屋的中位数值,这是一个效果良好的例子.https://heuristically.wordpress.com/2011/11/17/using-neural-network-for-regression/
library(mlbench)
data(BostonHousing)
require(nnet)
# scale inputs: divide by 50 to get 0-1 range
nnet.fit <- nnet(medv/50 ~ ., data=BostonHousing, size=2)
# multiply 50 to restore original scale
nnet.predict <- predict(nnet.fit)*50
Run Code Online (Sandbox Code Playgroud)
nnet.predict [,1] 1 23.70904 2 23.70904 3 23.70904 4 23.70904 5 23.70904 6 23.70904 7 23.70904 8 23.70904 9 23.70904 10 23.70904 11 23.70904 12 23.70904 13 23.70904 14 23.70904 15 23.70904
对于所有506个观测值的所有预测,我得到23.70904相同的值?为什么会这样?我做错了什么?
我的R版本是3.1.2.