- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用以下代码训练 h2o 模型并对新数据进行预测,但这会导致错误。如何避免这个错误?
library(mlr)
a <- data.frame(y=factor(c(1,1,1,1,1,1,1,1,0,0,1,0)),
x1=rep(c("a","b","c"), times=c(6,3,3)))
aTask <- makeClassifTask(data = a, target = "y", positive = "1")
h2oLearner <- makeLearner("classif.h2o.deeplearning",
predict.type = "prob")
model <- train(h2oLearner, aTask)
b <- data.frame(x1=rep(c("a","b", "c"), times=c(3,5,4)))
pred <- predict(model, newdata=b)
导致以下错误:
Error in checkPredictLearnerOutput(.learner, .model, p) :
predictLearner for classif.h2o.deeplearning has returned not the class levels as column names: p0,p1
如果我将 Predict.type 更改为“response”,它就会起作用。那么如何预测概率呢?
最佳答案
此错误已在 this commit 中修复并将在下一个版本中出现。在此之前,您可以安装 Github 版本:
devtools::install_github("mlr-org/mlr")
关于r - 使用 mlr 预测错误 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45009855/
我想比较简单的逻辑回归模型,其中每个模型仅考虑一组指定的特征。我想在数据重新采样时对这些回归模型进行比较。 R 包 mlr 允许我使用 dropFeatures 在任务级别选择列。代码类似于: ful
我想比较简单的逻辑回归模型,其中每个模型仅考虑一组指定的特征。我想在数据重新采样时对这些回归模型进行比较。 R 包 mlr 允许我使用 dropFeatures 在任务级别选择列。代码类似于: ful
mlr 包很棒,创建 ModelMultiplexer 的想法也有帮助。但是 ModelMultiplexer 从所使用的模型中“选择”1 个模型。 是否有任何支持或计划支持创建单个模型的 Bagge
我在 mlr cheatsheet 中使用基于快速入门示例的代码。我添加了并行化并尝试多次调整参数。 问题:为什么即使我每次在调优前都设置了set.seed(),重现性还是会失败(为什么结果不一样)?
我在基准实验中使用嵌套交叉验证。我想检索用于每个外循环的实例的索引。我知道有一个函数 getResamplingIndices() 适合此任务。但它不接受“BenchmarkResult”对象。有办法
我正在 R 中使用 mlr 包来比较二元分类任务中的两个学习器,即随机森林和套索分类器。我使用嵌套交叉验证来计算性能。然后,我想计算特征对于最佳分类器(本例中的随机森林)的重要性。为了实现这一目标,我
我正在创建自定义学习器,特别是我正在尝试使用 h2o mlr 框架内的机器学习算法。 h2o.deeplearning 函数的“隐藏”参数是一个我想要调整的整数向量。我通过以下方式定义了“隐藏”参数:
我正在使用 R 3.6.1、RStudio 1.2.5019 和 mlr 2.15.0。已安装并加载 MLR。只加载 mlr 和构建 mlr 的包。 现在,我已经使用 train 训练了一个模型。并希
如果我在不平衡的二元目标变量的情况下使用欠采样来训练模型,则预测方法会在平衡数据集的假设下计算概率。如何将这些概率转换为不平衡数据的实际概率?转换参数/函数是在 mlr 包还是其他包中实现的?例如:
如果我想使用 mlr 包对新数据进行预测,如何预处理新数据,以便使用原始数据预处理所需的信息。例如。如果我合并小因子水平并且新数据集中的频率与第一个数据集不同,则生成的因子水平可能不同并且无法进行预测
我尝试使用以下代码训练 h2o 模型并对新数据进行预测,但这会导致错误。如何避免这个错误? library(mlr) a <- data.frame(y=factor(c(1,1,1,1,1,1,1,
我想知道函数 normalizeFeatures 如何与重采样策略一起工作。以下哪个说法是正确的? 整个任务数据归一化 训练数据被规范化,规范化的参数(比方说,经典标准化中的均值和标准差)用于规范化验
运行 Benchmark Experiment 时在多种算法上,通过调整包装器等。每种算法都会返回多个模型。 提取每个单独的调整模型(具有各种超参数)的规范方法或有效方法是什么,以便可以单独访问它们,
我正在一项任务中使用基准实验。我正在使用嵌套重采样策略( https://mlr-org.github.io/mlr-tutorial/devel/html/nested_resampling/ind
我正在使用学习器 regr.gbm 来预测计数。在 mlr 之外,直接使用 gbm 包,我使用 distribution = "poisson" 和 predict.gbm,使用 type = "re
我想问是否可以保存在参数调整过程中创建的所有模型,例如使用 tuneParams 函数。我想保存每个超参数集的每次交叉验证的模型。 我可以看到 resample 和 benchmark 函数都有 mo
我关注这个伟大的网站已经很久了。今天,当我遇到一个问题时,我终于决定创建一个帐户。 我的问题是相当基本的 vlcj 执行。我有一个程序作为音频播放器运行。除了一个我似乎无法弄清楚的问题外,一切都已完成
我想检查计算中的中间步骤,但我不知道该怎么做。 书中的例子: mutate = mlr_pipeops$get("mutate") filter = mlr_pipeops$get("filter",
我刚刚从 caret 切换过来至mlr对于我目前正在研究的一个具体问题。我想知道这里是否有人熟悉在 resample() 中指定自定义性能度量功能。 这是一个可重现的代码示例: library(mlr
我想获取 mlr 包中集成的所有聚类算法的列表。我预计此代码会返回它们,但它排除了已卸载的代码: library(mlr) listLearners("cluster") # default: cre
我是一名优秀的程序员,十分优秀!