[英]How to map transform in r-drake
May i ask how to use function GraphLearner$new
to transform in r-drake.请问如何使用函数
GraphLearner$new
在r-drake 中进行转换。 The codes following:代码如下:
learner_plan = drake_plan(
## 1. Choose learner--------------------------------------------------------
polrn_classif = target(fnc_po_learner(list_learners),
transform = map(
list_learners = c(
"classif.ranger",
"classif.lightgbm",
"classif.xgboost",
"classif.log_reg",
"classif.svm"
)
)),
graph_classif = target(
imputer_classif %>>% filter_classif %>>% polrn_classif,
transform = map(polrn_classif)
),
glrn_classif = target({
GraphLearner$new(graph = graph_classif) # get error ---------- it's not transform
transform = map(graph_classif)
})
)
learner_plan
transform = map(graph_classif)
should go outside the curly braces. transform = map(graph_classif)
应该放在花括号之外。
library(drake)
learner_plan = drake_plan(
polrn_classif = target(
fnc_po_learner(list_learners),
transform = map(
list_learners = c(
"classif.ranger",
"classif.lightgbm",
"classif.xgboost",
"classif.log_reg",
"classif.svm"
)
)
),
graph_classif = target(
imputer_classif %>>% filter_classif %>>% polrn_classif,
transform = map(polrn_classif)
),
glrn_classif = target({
GraphLearner$new(graph = graph_classif)
}, transform = map(graph_classif)) # outside the curly braces
)
plot(learner_plan)
Created on 2021-07-07 by the reprex package (v2.0.0)由reprex 包( v2.0.0 ) 于 2021 年 7 月 7 日创建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.