如何用R来构造R中的神经网络

时间:2021-10-13 07:17:00

So I've been using the caret package to perform stuff like MLR, stepwise regression and random forest through the use of the train function. I've done this so that I can also do 10 fold cross validation 10 times, and I've done this by doing the following:-

所以我一直在使用插入包通过使用列车功能执行MLR,逐步回归和随机森林之类的东西。我这样做了,所以我也可以进行10次交叉验证10次,我通过以下方式做到了这一点: -

library(caret)
ctrl <- trainControl(method = "repeatedcv", number = "10", repeats = "10", savePred = T)
cadets.mlr <- train(RT..seconds~., data = cadets, method = 'lm', trControl = ctrl)

From which I can then look at the predicted and observed values and plot them against each other and etc to see how accurate the model is. RT..seconds is the variable I want to model against 160 other variables for 180 different instances (i.e. 180 x 160 dataset).

然后,我可以从中查看预测值和观测值,并将它们相互绘制等等,以了解模型的准确程度。 RT..seconds是我想要针对180个不同实例(即180 x 160数据集)的160个其他变量建模的变量。

I want to do the same thing but through the use of a neural network model. I want the learning ate to be 0.25 and momentum to be 50. I came across 'AMORE' and tried to do the same thing but using that instead by doing:-

我想做同样的事情,但通过使用神经网络模型。我希望学习成为0.25,动力为50.我遇到了'AMORE'并试图做同样的事情,但是通过这样做: -

cadets.nn <- train(RT..seconds.~., data = cadets, method = 'AMORE', trControl = ctrl)

But I keep getting the following message :-

但我不断收到以下消息: -

Error in modelLookup(method) : value of model unknown

What am I doing wrong? And how do I go about tuning the parameters for Amore when I'm calling it through caret?

我究竟做错了什么?当我通过插入符号调用Amore时,如何调整Amore的参数?

Thanks!

谢谢!

1 个解决方案

#1


1  

AMORE isn't currently wrapped by train. It has been requested previously, but it is difficult to abstract AMORE's modeling code to work with the possible cases that people may want.

AMORE目前没有被火车包裹。之前已经提出要求,但很难抽象出AMORE的建模代码来处理人们可能想要的可能情况。

The neural network models that are wrapped by train can be found here. As of this writing there are 13 different neural network models available.

可以在这里找到由火车包裹的神经网络模型。在撰写本文时,有13种不同的神经网络模型可用。

If none of those are what you would like and you are familiar with the AMORE package, you could write your own model code. See this page for instructions and examples on how to do that.

如果这些都不是您想要的并且您熟悉AMORE包,那么您可以编写自己的模型代码。有关如何执行此操作的说明和示例,请参阅此页面。

Max

马克斯

#1


1  

AMORE isn't currently wrapped by train. It has been requested previously, but it is difficult to abstract AMORE's modeling code to work with the possible cases that people may want.

AMORE目前没有被火车包裹。之前已经提出要求,但很难抽象出AMORE的建模代码来处理人们可能想要的可能情况。

The neural network models that are wrapped by train can be found here. As of this writing there are 13 different neural network models available.

可以在这里找到由火车包裹的神经网络模型。在撰写本文时,有13种不同的神经网络模型可用。

If none of those are what you would like and you are familiar with the AMORE package, you could write your own model code. See this page for instructions and examples on how to do that.

如果这些都不是您想要的并且您熟悉AMORE包,那么您可以编写自己的模型代码。有关如何执行此操作的说明和示例,请参阅此页面。

Max

马克斯