我的神经网络的输出是不变的

时间:2017-02-03 06:10:55

标签: r

我正在使用backprop算法来预测价格。我正在使用神经网络包。我的神经网络有一个隐藏层,有4个节点。我的网络输出是不变的,并且变化很小。我已将数据标准化。可能是什么问题

my neuralnet

      nn<- neuralnet(O.avgprice+O.firstquartil+O.thirdquartil~Timestamp+avg.price+weekday+firstquartil+thirdquartil+nooftransactions,
                 data = trainANN,hidden = c(4), algorithm = "backprop", rep = "1",learningrate = 0.01, threshold = 0.01, linear.output = F)

ン$ net.result [[1]]

      [,1] [,2]                 [,3]
     96121    1    1 0.000000018657606331
     24801    1    1 0.000000015347274146
     54704    1    1 0.000000017414965756
     54319    1    1 0.000000019182735544
     89317    1    1 0.000000019540763609
     34027    1    1 0.000000018349857324
     59145    1    1 0.000000018922293155
     93596    1    1 0.000000019104633387
     42171    1    1 0.000000018486794230
     77026    1    1 0.000000019084768899
     50876    1    1 0.000000017692360018
     83098    1    1 0.000000018162597292
     26539    1    1 0.000000014943126974
     88331    1    1 0.000000019915268711
     66083    1    1 0.000000019481553856

这是我如何规范我的数据

    maxs <- apply(m1,2,max)
    mins <- apply(m1,2,min)
    ANN <- as.data.frame(scale(m1,center = mins, scale = maxs - mins ))

如果需要更多信息,请告诉我

1 个答案:

答案 0 :(得分:0)

lapply performs better in scaling/normalising data of large volumes
 m <- function(x) {(x - min(x, na.rm=TRUE))/(max(x,na.rm=TRUE) - 
                                             min(x, na.rm=TRUE))} 

N <- as.data.frame(lapply(m1, doit))