我正在学习使用 AMORE 包来用最佳神经网络拟合数据,所以我在他的wiki 页面上关注示例,并且我试图运行以下代码但我不能,train 函数触发了消息错误:
modelLookup(method) : 模型未知值
require(AMORE)
## We create two artificial data sets. ''P'' is the input data set. ''target'' is the output.
P <- matrix(sample(seq(-1,1,length=500), 500, replace=FALSE), ncol=1)
target <- P^2 + rnorm(500, 0, 0.5)
## We create the neural network object
net.start <- newff(n.neurons=c(1,3,1),
learning.rate.global=1e-2,
momentum.global=0.5,
error.criterium="LMS",
Stao=NA, hidden.layer="tansig",
output.layer="purelin",
method="ADAPTgdwm")
## We train the network according to P and target.
result <- train(net.start, P, target, error.criterium="LMS", report=TRUE, show.step=100, n.shows=5 )
## Several graphs, mainly to remark that
## now the trained network is is an element of the resulting list.
y <- sim(result$net, P)
plot(P,y, col="blue", pch="+")
points(P,target, col="red", pch="x")
任何建议表示赞赏!