I am trying to predict median value of owner-occupied homes, its a worked example which is giving a good result.
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
I am getting 23.70904 same value for all the predict for all 506 observations ? Why is it so ? What is that I am doing wrong ?
My R version is 3.1.2.