用于Caret中mlpML的激活函数

我在R语言中使用Caret包,尝试实现多层感知器来对卫星图像进行分类。我使用了method=mlpML,我想知道使用的是哪种激活函数。

这是我的代码:

controlparameters<-trainControl(method = "repeatedcv",                               number=5,                               repeats = 5,                               savePredictions=TRUE,                                classProbs = TRUE)mlp_grid<-expand.grid(layer1=13,                      layer2=0,                      layer3=0)model< train(as.factor(Species)~.,                   data = smotedata,                   method='mlpML',                   preProc =  c('center', 'scale'),                   trcontrol=controlparameters,                   tuneGrid=mlp_grid,                   importance=T) 

我使用了单层,因为它的表现比多层更好。


回答:

查看Caret的源代码中关于mlpML的部分,发现它使用的是RSNNS包中的mlp函数。

根据RSNNS的mlp文档,其默认参数是:

mlp(x, ...)## Default S3 method:mlp(x, y, size = c(5), maxit = 100,  initFunc = "Randomize_Weights", initFuncParams = c(-0.3, 0.3),  learnFunc = "Std_Backpropagation", learnFuncParams = c(0.2, 0),  updateFunc = "Topological_Order", updateFuncParams = c(0),  hiddenActFunc = "Act_Logistic", shufflePatterns = TRUE,  linOut = FALSE, outputActFunc = if (linOut) "Act_Identity" else  "Act_Logistic", inputsTest = NULL, targetsTest = NULL,  pruneFunc = NULL, pruneFuncParams = NULL, ...)

由此可见,hiddenActFunc = "Act_Logistic",即隐藏层的激活函数是逻辑函数。

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注