查看原文
其他

CRAN任务视图:机器学习和统计学习

庄闪闪 庄闪闪的R语言手册 2023-09-04

点击下方公众号,回复资料分享,收获惊喜

翻译原文地址: https://CRAN.R-project.org/view=MachineLearning
译者:庄闪闪 + ChatGPT 3.5
版本:2023-04-05
来源:https://github.com/cran-task-views/MachineLearning/
温馨提示:正文包含5852字,140个链接,预计阅读时间15分钟。

相关推文:CRAN任务视图:贝叶斯推断R包综述CRAN任务视图:Sports Analytics

本文框架

  • 神经网络和深度学习

  • 递归分区

  • 随机森林

  • 正则化和收缩方法

  • Boosting 和梯度下降

  • 支持向量机和核方法

  • 贝叶斯方法

  • 使用遗传算法进行优化

  • 关联规则

  • 模糊规则系统

  • 模型选择和验证

  • 因果机器学习

  • 其他程序

  • Meta 包

  • 可视化

  • 可解释人工智能

神经网络和深度学习

在 R 的基础包中,使用nnet[1]包实现了单隐藏层神经网络。RSNNS[2]包提供了与 Stuttgart 神经网络模拟器的接口。实现深度学习神经网络功能的包如下:deepnet[3](前馈神经网络、受限玻尔兹曼机、深度置信网络、堆叠自动编码器)、RcppDL[4](去噪自动编码器、堆叠去噪自动编码器、受限玻尔兹曼机、深度置信网络)和h2o[5](前馈神经网络、深度自动编码器)。tensorflow[6]包提供了与TensorFlow[7]的接口。torch[8]包实现了与libtorch库[9]的接口。可以使用evreg[10]包中实现的 ENNreg 证据回归神经网络模型来量化预测的不确定性。

小编写过的类似推文:直播课件分享|深度学习教程基于 R 语言的深度学习——配置环境基于 R 语言的深度学习——简单回归案例基于 R 语言的深度学习——简介及资料分享

递归分区

根据 CART 的思想,rpart[11]tree[12]包实现了用于回归、分类和生存分析的树状模型。建议使用rpart[13]包来计算类似 CART 的树。Weka[14]提供了丰富的分区算法工具箱,RWeka[15]包提供了与该实现的接口,包括 C4.5 的 J4.8 变体和 M5。

Cubist[16]包使用线性回归模型拟合基于规则的模型(类似于树),在叶节点中进行基于实例的校正和 Boosting。C50[17]包可以拟合 C5.0 分类树、基于规则的模型和这些模型的 Boosting 版本。pre[18]可以拟合更广泛响应变量类型的基于规则的模型。party[19]partykit[20]包实现了两种具有无偏变量选择和统计停止准则的递归分区算法。ctree() 基于非参数条件进行推断,用于检验响应变量和每个输入变量之间的独立性,而 mob() 可用于对参数模型进行分区。

party[21]partykit[22]包还能可视化二叉树和响应的节点分布。使用glmertree[23]包可以对混合效应模型(GLMMs)进行分区;使用semtree[24]包可以对结构方程模型(SEMs)进行分区。maptree[25]包提供了用于可视化树的图形工具。使用RPMM[26]可以对混合模型进行分区。

partykit[27]中实现了用于表示树的计算基础设施和统一的预测和可视化方法。这个基础设施被evtree[28]包使用,用于实现全局最优树的进化学习。各种包中都提供了生存树的功能。

针对处理异质效应的子组识别树可以在以下包中找到:partykit[29]model4you[30]dipm[31]quint[32]pkg("SIDES")pkg("psica")pkg("MrSGUIDE")

随机森林

randomForest[33]包提供了用于回归和分类问题的随机森林算法实现。ipred[34]包提供了用于回归、分类和生存分析的装袋(bagging)方法,以及通过集成学习将多个模型组合的方法。

此外,party[35]包实现了基于条件推断树的随机森林变体,适用于任意尺度上测量的响应变量。randomForestSRC[36]包实现了对 Breiman 的随机森林在生存分析、回归和分类问题中的统一处理。

分位数回归森林quantregForest[37]可以通过随机森林方法将数值响应的分位数回归到探索性变量上。对于二元数据,varSelRF[38]Boruta[39]包专注于使用随机森林算法进行变量选择。此外,ranger[40]Rborist[41]包提供了快速的 C++ 实现的随机森林的 R 接口。

RLT[42]包实现了具有在树中重要的变量分割的强化学习树。wsrf[43]包提供了一种替代的变量加权方法,用于在变量子空间选择中替代传统的随机变量抽样。RGF[44]包是一个与 Python 实现的一种称为 "regularized greedy forests" 过程的接口。对于参数模型,可以使用trtf[45]grf[46]进行建模。

正则化和收缩方法

使用lars[47]包拟合具有参数估计约束的回归模型。grplasso[48]包提供了各组参数同时更新的 Lasso 方法(groupwise lasso);grpreg[49]包实现了其他一些组惩罚模型,如组 MCP 和组 SCAD。可以使用glmpath[50]包的函数获取广义线性模型和 Cox 模型的 L1 正则化路径,可以从glmnet[51]包获取线性回归、逻辑回归和多项式回归模型的完整 Lasso 或弹性网络正则化路径(也可使用elasticnet[52]包)。penalized[53]包提供了 Lasso(L1)和岭回归(L2)惩罚的替代实现(适用于广义线性模型和 Cox 模型)。

RXshrink[54]包可用于识别和显示指定收缩路径的 TRACE,并确定适当的收缩程度。ahaz[55]包提供了在 Lasso 惩罚下的半参数加性风险模型。penalizedLDA[56]包实现了 Fisher 的线性判别分析(LDA)投影,可选择使用 LASSO 惩罚以产生稀疏解。

pamr[57]包实现了收缩质心分类器和用于基因表达分析的实用工具。包earth[58]提供了多元自适应回归样条的实现。hda[59]包和sda[60]包实现了各种形式的惩罚判别分析。

LiblineaR[61]包提供了与 LIBLINEAR 库的接口。ncvreg[62]包使用坐标下降算法拟合带有 SCAD 和 MCP 回归惩罚的线性和逻辑回归模型。picasso[63]包也实现了相同的惩罚方法。

bmrm包[64]提供了一种用于正则化风险最小化的束方法的实现。hdm包[65]用于在非高斯和异方差误差下估计 Lasso 模型,还包括在高维设置中对 Lasso 回归和估计的处理效应的低维组件进行推断。SIS包[66]实现了在广义线性模型和Cox模型中的确实独立筛选。

joinet包[67]提供了用于相关输出的弹性网络方法。mpath包[68]使用共轭操作符的复合优化来拟合鲁棒的带惩罚的广义线性模型和鲁棒支持向量机。islasso包[69]基于引导平滑思想提供了 Lasso 模型的实现,可以获得所有模型参数的可靠 p 值。abess包[70]提供了基于快速多项式时间算法的线性、逻辑、Cox 和其他回归模型的最佳子集选择方法。

Boosting 和梯度下降

gbm[71]包实现了各种形式的梯度提升(基于树的函数梯度下降提升)。lightgbm[72]xgboost[73]包实现了基于树的提升,使用高效的树作为基础学习器,并支持多种预定义和用户自定义的目标函数。bst[74]包通过提升实现了Hinge损失的优化。

mboost[75]包提供了一个可扩展的提升框架,适用于广义线性、可加性和非参数模型。GMMBoost[76]实现了基于似然的混合模型提升。可以使用gamboostLSS[77]通过提升来拟合 GAMLSS 模型。

支持向量机和核方法

e1071[78]包中的 svm() 函数提供了与 LIBSVM 库的接口,而kernlab[79]包实现了一个灵活的核学习框架(包括支持向量机、相关向量机和其他核学习算法)。klaR[80]包提供了与 SVMlight 实现的接口(仅适用于一对多分类)。

贝叶斯方法

贝叶斯加性回归树(BART)是通过许多弱学习器的求和来定义最终模型(类似于集成方法),在BayesTree[81]BART[82]bartMachine[83]包中实现。tgp[84]包提供了贝叶斯非平稳、半参数非线性回归和基于树状高斯过程的设计,包括贝叶斯 CART 和树状线性模型。

BDgraph[85]包实现了用于多变量连续、离散和混合数据的无向图模型的贝叶斯结构学习;使用 spike-and-slab 先验的相应方法可以从ssgraph[86]包中获得。naivebayes[87]中提供了朴素贝叶斯分类器。

使用遗传算法进行优化

rgenoud[88]包提供了基于遗传算法的优化算法。Rmalschains[89]包实现了带有局部搜索链的模因算法,这是一种特殊类型的进化算法,将稳态遗传算法与局部搜索相结合,用于实值参数优化。

关联规则

arules[90]包提供了用于高效处理稀疏二进制数据的数据结构,以及对 Apriori 和 Eclat 的接口,用于挖掘频繁项集、最大频繁项集、闭合频繁项集和关联规则。opusminer[91]包提供了与 OPUS Miner 算法(用 C++ 实现)的接口,以高效地找到事务数据中的关键关联项,以自给自足的项集形式表示,可以使用杠杆或提升指标进行挖掘。

模糊规则系统

frbs[92]包实现了从数据中学习模糊规则系统的多种标准方法,用于回归和分类。RoughSets[93]包在一个单独的包中提供了粗糙集理论(RST)和模糊粗糙集理论(FRST)的全面实现。

模型选择和验证

e1071[94]包提供了用于超参数调优的 tune() 函数,ipred[95]中的 errorest() 函数可用于错误率估计。支持向量机的代价参数 C 可以使用svmpath[96]包的功能来选择。splitTools[97]包提供了用于交叉验证和其他重抽样方案的数据拆分功能。ROCR[98]包提供了用于 ROC 分析和其他比较候选分类器的可视化技术的函数。hdi[99]stabs[100]包实现了一系列模型的稳定性选择,hdi[101]还提供了高维模型中的其他推断过程。

因果机器学习

DoubleML[102]包是双重机器学习框架在各种因果模型中的面向对象实现。在mlr3[103]生态系统的基础上,可以基于广泛的机器学习方法集合来估计因果效应。

其他程序

evclass[104]包中的证据分类器使用 Dempster-Shafer 质量函数来量化关于测试模式类别的不确定性。OneR[105]包提供了一个分类算法,增强了对缺失值和数值数据的复杂处理,并提供了广泛的诊断功能。

Meta 包

tidymodels[106]包提供了构建预测模型的各种函数,包括参数调整和变量重要性度量。mlr3[107]包提供了与各种统计和机器学习包的高级接口。

SuperLearner[108]包实现了类似的工具箱。h2o[109]包实现了一个通用的机器学习平台,其中包括许多流行算法的可扩展实现,如随机森林、GBM、GLM(带有弹性网正则化)和深度学习(前馈多层网络),等等。

mlpack[110]包提供了与 mlpack C++ 库的接口。CORElearn[111]实现了一类相当广泛的机器学习算法,例如最近邻、树、随机森林和几种特征选择方法。

类似地,rminer[112]包接口了其他包中实现的几种学习算法,并计算了几种性能度量。

可视化

stats::termplot()函数可以用于绘制模型中的项,其中预测方法支持 type="terms"effects[113]包为具有线性预测器(例如:线性和广义线性模型)的模型提供了图形和表格效果展示。弗里德曼的偏依赖图(PDPs)是对预测函数的低维图形呈现,几个包中实现了这种功能。gbm[114]randomForest[115]randomForestSRC[116]提供了自己的函数用于显示PDPs,但仅限于使用这些包拟合的模型(randomForest[117]partialPlot() 函数更受限制,因为它一次只允许一个预测变量)。

pdp[118]plotmo[119]ICEbox[120]等包更通用,可以创建各种机器学习模型(例如随机森林、支持向量机等)的 PDPs;pdp[121]plotmo[122]都支持多变量显示(plotmo[123]限于两个预测变量,而pdp[124]使用网格图形显示涉及三个预测变量的 PDPs)。默认情况下,plotmo[125]将背景变量固定为它们的中位数(或因子的第一个水平),这比构造 PDPs 更快,但包含的信息较少。

ICEbox[126]专注于构建个体条件期望(ICE)曲线,这是对弗里德曼的 PDPs 的一种改进。可以使用pdp[127]包的 partial() 函数构建 ICE 曲线以及居中的 ICE 曲线。

可解释人工智能

上一节“可视化”中的大多数包和函数属于可解释人工智能领域。DALEX[128]iml[129]包提供了不同的方法来解释任何模型,包括部分依赖性、累积局部效应和排列重要性。累积局部效应图也可以直接在ALEPlot[130]中获得。SHAP 是解释机器学习模型最常用的技术之一。它以公平的方式将预测分解为各个预测变量的加法贡献。对于基于树的模型,存在非常快速的 TreeSHAP 算法,它直接集成在h2o[131]xgboost[132]lightgbm[133]中。SHAP 的与模型无关的实现可在其他包中找到:fastshap[134]主要使用蒙特卡洛采样来近似 SHAP 值,而shapr[135]kernelshap[136]提供了 KernelSHAP 的实现。这些包中的 SHAP 值可以使用shapviz[137]包进行绘制。还可以使用shapper[138]提供的 Python 的 shap 包进行转换。其他预测分解的方法实现在lime[139]iBreakDown[140]中。

参考资料

[1]

nnet: https://cran.r-project.org/web/packages/nnet/index.html

[2]

RSNNS: https://cran.r-project.org/web/packages/RSNNS/index.html

[3]

deepnet: https://cran.r-project.org/web/packages/deepnet/index.html

[4]

RcppDL: https://cran.r-project.org/web/packages/RcppDL/index.html

[5]

h2o: https://cran.r-project.org/web/packages/h2o/index.html

[6]

tensorflow: https://cran.r-project.org/web/packages/tensorflow/index.html

[7]

TensorFlow: http://www.tensorflow.org/

[8]

torch: https://cran.r-project.org/web/packages/torch/index.html

[9]

libtorch库: https://pytorch.org/

[10]

evreg: https://cran.r-project.org/web/packages/evreg/index.html

[11]

rpart: https://cran.r-project.org/web/packages/rpart/index.html

[12]

tree: https://cran.r-project.org/web/packages/tree/index.html

[13]

rpart: https://cran.r-project.org/web/packages/rpart/index.html

[14]

Weka: http://www.cs.waikato.ac.nz/~ml/weka/

[15]

RWeka: https://cran.r-project.org/web/packages/RWeka/index.html

[16]

Cubist: https://cran.r-project.org/web/packages/Cubist/index.html

[17]

C50: https://cran.r-project.org/web/packages/C50/index.html

[18]

pre: https://cran.r-project.org/web/packages/pre/index.html

[19]

party: https://cran.r-project.org/web/packages/party/index.html

[20]

partykit: https://cran.r-project.org/web/packages/partykit/index.html

[21]

party: https://cran.r-project.org/web/packages/party/index.html

[22]

partykit: https://cran.r-project.org/web/packages/partykit/index.html

[23]

glmertree: https://cran.r-project.org/web/packages/glmertree/index.html

[24]

semtree: https://cran.r-project.org/web/packages/semtree/index.html

[25]

maptree: https://cran.r-project.org/web/packages/maptree/index.html

[26]

RPMM: https://cran.r-project.org/web/packages/RPMM/index.html

[27]

partykit: https://cran.r-project.org/web/packages/partykit/index.html

[28]

evtree: https://cran.r-project.org/web/packages/evtree/index.html

[29]

partykit: https://cran.r-project.org/web/packages/partykit/index.html

[30]

model4you: https://cran.r-project.org/web/packages/model4you/index.html

[31]

dipm: https://cran.r-project.org/web/packages/dipm/index.html

[32]

quint: https://cran.r-project.org/web/packages/quint/index.html

[33]

randomForest: https://cran.r-project.org/web/packages/randomForest/index.html

[34]

ipred: https://cran.r-project.org/web/packages/ipred/index.html

[35]

party: https://cran.r-project.org/web/packages/party/index.html

[36]

randomForestSRC: https://cran.r-project.org/web/packages/randomForestSRC/index.html

[37]

quantregForest: https://cran.r-project.org/web/packages/quantregForest/index.html

[38]

varSelRF: https://cran.r-project.org/web/packages/varSelRF/index.html

[39]

Boruta: https://cran.r-project.org/web/packages/Boruta/index.html

[40]

ranger: https://cran.r-project.org/web/packages/ranger/index.html

[41]

Rborist: https://cran.r-project.org/web/packages/Rborist/index.html

[42]

RLT: https://cran.r-project.org/web/packages/RLT/index.html

[43]

wsrf: https://cran.r-project.org/web/packages/wsrf/index.html

[44]

RGF: https://cran.r-project.org/web/packages/RGF/index.html

[45]

trtf: https://cran.r-project.org/web/packages/trtf/index.html

[46]

grf: https://cran.r-project.org/web/packages/grf/index.html

[47]

lars: https://cran.r-project.org/web/packages/lars/index.html

[48]

grplasso: https://cran.r-project.org/web/packages/grplasso/index.html

[49]

grpreg: https://cran.r-project.org/web/packages/grpreg/index.html

[50]

glmpath: https://cran.r-project.org/web/packages/glmpath/index.html

[51]

glmnet: https://cran.r-project.org/web/packages/glmnet/index.html

[52]

elasticnet: https://cran.r-project.org/web/packages/elasticnet/index.html

[53]

penalized: https://cran.r-project.org/web/packages/penalized/index.html

[54]

RXshrink: https://cran.r-project.org/web/packages/RXshrink/index.html

[55]

ahaz: https://cran.r-project.org/web/packages/ahaz/index.html

[56]

penalizedLDA: https://cran.r-project.org/web/packages/penalizedLDA/index.html

[57]

pamr: https://cran.r-project.org/web/packages/pamr/index.html

[58]

earth: https://cran.r-project.org/web/packages/earth/index.html

[59]

hda: https://cran.r-project.org/web/packages/hda/index.html

[60]

sda: https://cran.r-project.org/web/packages/sda/index.html

[61]

LiblineaR: https://cran.r-project.org/web/packages/LiblineaR/index.html

[62]

ncvreg: https://cran.r-project.org/web/packages/ncvreg/index.html

[63]

picasso: https://cran.r-project.org/web/packages/picasso/index.html

[64]

bmrm包: https://cran.r-project.org/web/packages/bmrm/index.html

[65]

hdm包: https://cran.r-project.org/web/packages/hdm/index.html

[66]

SIS包: https://cran.r-project.org/web/packages/SIS/index.html

[67]

joinet包: https://cran.r-project.org/web/packages/joinet/index.html

[68]

mpath包: https://cran.r-project.org/web/packages/mpath/index.html

[69]

islasso包: https://cran.r-project.org/web/packages/islasso/index.html

[70]

abess包: https://cran.r-project.org/web/packages/abess/index.html

[71]

gbm: https://cran.r-project.org/web/packages/gbm/index.html

[72]

lightgbm: https://cran.r-project.org/web/packages/lightgbm/index.html

[73]

xgboost: https://cran.r-project.org/web/packages/xgboost/index.html

[74]

bst: https://cran.r-project.org/web/packages/bst/index.html

[75]

mboost: https://cran.r-project.org/web/packages/mboost/index.html

[76]

GMMBoost: https://cran.r-project.org/web/packages/GMMBoost/index.html

[77]

gamboostLSS: https://cran.r-project.org/web/packages/gamboostLSS/index.html

[78]

e1071: https://cran.r-project.org/web/packages/e1071/index.html

[79]

kernlab: https://cran.r-project.org/web/packages/kernlab/index.html

[80]

klaR: https://cran.r-project.org/web/packages/klaR/index.html

[81]

BayesTree: https://cran.r-project.org/web/packages/BayesTree/index.html

[82]

BART: https://cran.r-project.org/web/packages/BART/index.html

[83]

bartMachine: https://cran.r-project.org/web/packages/bartMachine/index.html

[84]

tgp: https://cran.r-project.org/web/packages/tgp/index.html

[85]

BDgraph: https://cran.r-project.org/web/packages/BDgraph/index.html

[86]

ssgraph: https://cran.r-project.org/web/packages/ssgraph/index.html

[87]

naivebayes: https://cran.r-project.org/web/packages/naivebayes/index.html

[88]

rgenoud: https://cran.r-project.org/web/packages/rgenoud/index.html

[89]

Rmalschains: https://cran.r-project.org/web/packages/Rmalschains/index.html

[90]

arules: https://cran.r-project.org/web/packages/arules/index.html

[91]

opusminer: https://cran.r-project.org/web/packages/opusminer/index.html

[92]

frbs: https://cran.r-project.org/web/packages/frbs/index.html

[93]

RoughSets: https://cran.r-project.org/web/packages/RoughSets/index.html

[94]

e1071: https://cran.r-project.org/web/packages/e1071/index.html

[95]

ipred: https://cran.r-project.org/web/packages/ipred/index.html

[96]

svmpath: https://cran.r-project.org/web/packages/svmpath/index.html

[97]

splitTools: https://cran.r-project.org/web/packages/splitTools/index.html

[98]

ROCR: https://cran.r-project.org/web/packages/ROCR/index.html

[99]

hdi: https://cran.r-project.org/web/packages/hdi/index.html

[100]

stabs: https://cran.r-project.org/web/packages/stabs/index.html

[101]

hdi: https://cran.r-project.org/web/packages/hdi/index.html

[102]

DoubleML: https://cran.r-project.org/web/packages/DoubleML/index.html

[103]

mlr3: https://cran.r-project.org/web/packages/mlr3/index.html

[104]

evclass: https://cran.r-project.org/web/packages/evclass/index.html

[105]

OneR: https://cran.r-project.org/web/packages/OneR/index.html

[106]

tidymodels: https://cran.r-project.org/web/packages/tidymodels/index.html

[107]

mlr3: https://cran.r-project.org/web/packages/mlr3/index.html

[108]

SuperLearner: https://cran.r-project.org/web/packages/SuperLearner/index.html

[109]

h2o: https://cran.r-project.org/web/packages/h2o/index.html

[110]

mlpack: https://cran.r-project.org/web/packages/mlpack/index.html

[111]

CORElearn: https://cran.r-project.org/web/packages/CORElearn/index.html

[112]

rminer: https://cran.r-project.org/web/packages/rminer/index.html

[113]

effects: https://cran.r-project.org/web/packages/effects/index.html

[114]

gbm: https://cran.r-project.org/web/packages/gbm/index.html

[115]

randomForest: https://cran.r-project.org/web/packages/randomForest/index.html

[116]

randomForestSRC: https://cran.r-project.org/web/packages/randomForestSRC/index.html

[117]

randomForest: https://cran.r-project.org/web/packages/randomForest/index.html

[118]

pdp: https://cran.r-project.org/web/packages/pdp/index.html

[119]

plotmo: https://cran.r-project.org/web/packages/plotmo/index.html

[120]

ICEbox: https://cran.r-project.org/web/packages/ICEbox/index.html

[121]

pdp: https://cran.r-project.org/web/packages/pdp/index.html

[122]

plotmo: https://cran.r-project.org/web/packages/plotmo/index.html

[123]

plotmo: https://cran.r-project.org/web/packages/plotmo/index.html

[124]

pdp: https://cran.r-project.org/web/packages/pdp/index.html

[125]

plotmo: https://cran.r-project.org/web/packages/plotmo/index.html

[126]

ICEbox: https://cran.r-project.org/web/packages/ICEbox/index.html

[127]

pdp: https://cran.r-project.org/web/packages/pdp/index.html

[128]

DALEX: https://cran.r-project.org/web/packages/DALEX/index.html

[129]

iml: https://cran.r-project.org/web/packages/iml/index.html

[130]

ALEPlot: https://cran.r-project.org/web/packages/ALEPlot/index.html

[131]

h2o: https://cran.r-project.org/web/packages/h2o/index.html

[132]

xgboost: https://cran.r-project.org/web/packages/xgboost/index.html

[133]

lightgbm: https://cran.r-project.org/web/packages/lightgbm/index.html

[134]

fastshap: https://cran.r-project.org/web/packages/fastshap/index.html

[135]

shapr: https://cran.r-project.org/web/packages/shapr/index.html

[136]

kernelshap: https://cran.r-project.org/web/packages/kernelshap/index.html

[137]

shapviz: https://cran.r-project.org/web/packages/shapviz/index.html

[138]

shapper: https://cran.r-project.org/web/packages/shapper/index.html

[139]

lime: https://cran.r-project.org/web/packages/lime/index.html

[140]

iBreakDown: https://cran.r-project.org/web/packages/iBreakDown/index.html

推荐: 可以保存以下照片,在b站扫该二维码,或者b站搜索【庄闪闪】观看Rmarkdown系列的视频教程。Rmarkdown视频新增两节视频(写轮眼幻灯片制作)需要视频内的文档,可在公众号回复【rmarkdown


您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存