简体   繁体   English

相当于 R 中插入符号模型 selectionFunction 的 mlr

[英]mlr equivalent of carets model selectionFunction in R

The caret library in R has a hyper-parameter 'selectionFunction' inside trainControl(). R 中的插入符号库在 trainControl() 中有一个超参数“selectionFunction”。 It's used to prevent over-fitting models using Breiman's one standard error rule, or tolerance, etc.它用于使用 Breiman 的一种标准误差规则或容差等来防止过度拟合模型。

Does mlr have an equivalent? mlr 有等价物吗? If so, which function is it within?如果是,它在哪个功能内?

mlr only allows to choose optimal hyperparameters by optimizing certain measures/metrics. mlr只允许通过优化某些度量/指标来选择最佳超参数。

However, essentially each "measure" in mlr is just a function that specifies how a certain performance is handled.但是,基本上mlr 中的每个“度量”只是一个函数,用于指定如何处理某个性能。 You can try to write your own custom measure as outlined in this vignette .您可以尝试编写自己的自定义度量,如 本小插图中所述

Other than that, it might be worth opening this as a feature request in the new mlr3 framework, specifically in mlr3measures , since mlr itself is deprecated.除此之外,可能值得在新的mlr3框架中将其作为功能请求打开,特别是在mlr3measures 中,因为mlr本身已被弃用。

Posting an answer to my own question, I found this.发布我自己的问题的答案,我发现了这一点。 . .

Estimate relative overfitting.估计相对过拟合。

Source: R/relativeOverfitting.R资料来源: R/relativeOverfitting.R

Estimates the relative overfitting of a model as the ratio of the difference in test and train performance to the difference of test performance in the no-information case and train performance.将模型的相对过拟合估计为测试和训练性能差异与无信息情况下测试性能和训练性能差异的比率。 In the no-information case the features carry no information with respect to the prediction.在无信息情况下,特征不携带关于预测的信息。 This is simulated by permuting features and predictions.这是通过置换特征和预测来模拟的。

estimateRelativeOverfitting(
  predish,
  measures,
  task,
  learner = NULL,
  pred.train = NULL,
  iter = 1
)

Arguments参数

  • predish - ( ResampleDesc ResamplePrediction Prediction ) Resampling strategy or resampling prediction or test predictions. predish - ( ResampleDesc ResamplePrediction Prediction ) 重采样策略或重采样预测或测试预测。
  • measures - ( Measure list of Measure ) Performance measure(s) to evaluate.措施- (测量的列表措施)绩效指标(S)来评价。 Default is the default measure for the task, see here getDefaultMeasure . Default 是任务的默认度量,请参见此处的getDefaultMeasure
  • task - ( Task ) The task.任务- ( Task ) 任务。
  • learner - ( Learner character(1) ) The learner.学习者- (学习者character(1) )学习者。 If you pass a string the learner will be created via makeLearner .如果您传递一个字符串,学习者将通过makeLearner创建。
  • pred.train - ( Prediction ) Training predictions. pred.train -(预测)训练预测。 Only needed if test predictions are passed.仅当测试预测通过时才需要。
  • iter - ( integer ) Iteration number. iter - (整数)迭代次数。 Default 1, usually you don't need to specify this.默认为 1,通常不需要指定。 Only needed if test predictions are passed.仅当测试预测通过时才需要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM