我正在尝试预测自住房屋的中位数价值,这是一个可行的示例,结果良好。
我在所有506个观测值的预测中得到了23.70904相同的值?为什么会这样?我做错了什么吗?
我的R版本是3.1.2。
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
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。