这应该作为输出为61,因为我使用1到59的训练编号的简单示例作为输入并且具有60分钟作为输出...然后我使用2到60个数字并且看到结果它给出为60这个简单的系列是错误的吗?
library("neuralnet")
testtime=59
i=59
s=61
testinput=0
testresults_values=0
testtrainingoutput=0
xnam_2 <- paste0("testinput[",1:i,"]")
(fmla_2 <- as.formula(paste("testInsertoutput[",60,"]~", paste(xnam_2, collapse= "+"))))
testtraininginput=seq(1,59,by=1)
testinput[1:59]=testtraininginput
testtrainingoutput[60] <- 60
#if(is.na(trainingoutput)==TRUE){break} - Can be used for future
testInsertoutput=testtrainingoutput
data=cbind(testinput,testInsertoutput)
testnet.sqrt<- neuralnet(fmla_2,data,hidden=1)
testdata_new<- seq(2,60,by=1)
testnewvale=as.data.frame(t(testdata_new))
testnet.results <- compute(testnet.sqrt,testnewvale[,1:testtime]) #Run them through the neural
testresults_values=testnet.results$net.result
testresults_values