简体   繁体   English

在 R 中测试具有连续输出的神经网络

[英]Testing Neural Network with Continuous Output in R

Trying to use the neuralnet package in calculating the continuous output and apply it to my testset to calculate error rate.尝试使用神经网络包计算连续输出并将其应用于我的测试集以计算错误率。

However, my predicted output seems to be the same.但是,我的预测输出似乎相同。

m1 <- neuralnet(SalaryNormalized ~ factor1 + factor2 + factor3, 
            data=GC_train, hidden=2, err.fct="sse", linear.output=TRUE,stepmax=1e6)

GC_test1<-GC_test
GC_test1$SalaryNormalized<-NULL
res$net.result

my results show all of the same value, I understand that scaling might be required when using continuous variables on the neuralnet package.我的结果显示所有相同的值,我知道在神经网络包上使用连续变量时可能需要缩放。 Does my predicted variable requires scaling too?我的预测变量是否也需要缩放?

res <- neuralnet::compute(m1, GC_test1)
testset.error <- GC_test$SalaryNormalized - res

Additionally, i tried to calculate the error and got this error另外,我试图计算错误并得到这个错误

Error in GC_test$SalaryNormalized - res : 
non-numeric argument to binary operator

You can ues it你可以使用它

sigmoid = function(x) {1 / (1 + exp(-x))} sigmoid = function(x) {1 / (1 + exp(-x))}

nn <- neuralnet(X06.Offset + X16.Offset ~ Mold.temp + Hot.Runner.temp + Holding.pressure + Holding.time +Injection.speed ,data=train_,hidden=c(2,3), linear.output=T,act.fct = sigmoid , learningrate = 0.01, threshold = 0.01, stepmax = 5e7) nn <- 神经网络(X06.Offset + X16.Offset ~ Mold.temp + Hot.Runner.temp + Holding.pressure + Holding.time +Injection.speed ,data=train_,hidden=c(2,3), 线性。 output=T,act.fct = sigmoid , learningrate = 0.01, threshold = 0.01, stepmax = 5e7)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM