machine-learning - 将 Tibble 转换为 h2o hex 文件时出错
问题描述
我在 Rstudio 中运行 h2o 包,将 Tibble 转换为 h2o 时出现错误。
下面是我的代码
#Augment Time Series Signature
PO_Data_aug = PO_Data %>%
tk_augment_timeseries_signature()
PO_Data_aug
# Split into training, validation and test sets
train_tbl = PO_Data_aug %>% filter(Date <= '2017-12-29')
valid_tbl = PO_Data_aug %>% filter(Date>'2017-12-29'& Date <='2018-03-31')
test_tbl = PO_Data_aug %>% filter(Date > '2018-03-31')
str(train_tbl)
train_tbl$month.lbl<-as.character(train_tbl$month.lbl)
h2o.init() # Fire up h2o
##hex
train_h2o = as.h2o(train_tbl)
valid_h2o = as.h2o(valid_tbl)
test_h2o = as.h2o(test_tbl)
ERROR: Unexpected HTTP Status code: 412 Precondition Failed (url = http://localhost:54321/3/Parse)
ERROR MESSAGE:
Provided column type ordered is unknown. Cannot proceed with parse due to invalid argument.
请建议
解决方案
这实际上是 H2O 中的一个错误——它与 tibbles 无关。data.frames 或 tibbles 中不支持“有序”列类型。我们会解决这个问题(票在这里)。
现在的解决方法是将“有序”列手动转换为无序“因子”列。
tb <- tibble(x = ordered(c(1,2,3)), y = 1:3)
tb$x <- factor(tb$x, ordered = FALSE)
hf <- as.h2o(tb)
推荐阅读
- laravel - Laravel 查询构建器:使用 `Case` 和 `Joins`
- reactjs - react formik 条件渲染初始值
- r - 尽管有重复,但分位数削减
- reactjs - 在 redux 操作中重定向,url 更改但页面不更改
- javascript - JS 函数在控制台上有效,但在代码中无效
- python - /admin/login/samesite 处的 ValueError 必须是“lax”或“strict”
- c# - c#/xml String.Contains 使用自定义类时无法正确返回字符串
- java - 如何向我的音频文件添加适当的 thymeleaf 源?
- excel - 如何选择具有置信区间收敛的特定单元格
- c - C 中的指针,返回 C 中的额外参数