I have tried deepnet library in R on Boston dataset.
data("Boston",package="MASS")
data <- Boston
Retaining only those variable we want to use:
keeps <- c("crim", "indus", "nox", "rm" , "age", "dis", "tax" ,"ptratio", lstat" ,"medv" )
data <- data[keeps]
library(deepnet)
#Next, use the set.seed method for reproducibility, and store the attributes in the R object X with the response variable in the R object Y:
set.seed (2016)
X= as.matrix(data[train ,1:9] )
Y= as.matrix(data[train ,10])
#Creating a DNN:
fitB<-.train(x=X, y=Y, initW = NULL , initB = NULL , hidden = c(10 ,12 ,20) , leaingrate = 0.58, momentum =0.74, leaingrate_scale =1 , activationfun = "sigm", output = "linear",numepochs = 970, batchsize = 60, hidden_dropout = 0, visible_dropout = 0)
Xtest<- as.matrix(data[-train ,1:9])
predB <- .predict(fitB , Xtest)
predB seem to be having same output.
Now, if I want to measure the performance, through following, I am not getting the desired result.
round(cor(predB ,data[-train ,10])^2 ,6)
mse(data [-train ,10] , predB)
rmse (data [-train ,10] , predB)
Results of above should be around:
round(cor(predB ,data[-train ,10])^2 ,6)
0.930665
mse(data [-train ,10] , predB)
0.08525447959
rmse (data [-train ,10] , predB)
0.2919836975
How can I get the above desired results using deepnet ?
