悬赏 1 个论坛币 未解决
麻烦各位大神帮帮忙~在用r软件建立bp神经网络时遇到问题~
r语言源代码为:
建立bp网络:
net <- newff(n.neurons=c(50,8,2,1), learning.rate.global=1e-2, momentum.global=0.5,
error.criterium="LMS", Stao=NA, hidden.layer="tansig",
output.layer="purelin", method="ADAPTgdwm")
(1)训练bp网络
result <- train(net, trainset[,-51],trainset$y, error.criterium="LMS", report=TRUE, show.step=100, n.shows=5 )
错误提示:
Error in train.method(net, P, T, show.step, n.threads = n.threads) :
REAL() can only be applied to a 'numeric', not a 'character'
(2)采用x=matrix(as.numeric(x),nrow=nrow(x))语句想将字符型改为数字型出现错误提示:
Error in matrix(as.numeric(x), nrow = nrow(x)) : (list) object cannot be coerced to type 'double'
(3)模型之前想对数据进行标准化用语句
scale(x, scale = TRUE)出现错误提示:Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric。