bnlearn 4.6版如何使用自定义评分函数?

How to use custom score functions in bnlearn version 4.6?

bnlearn 4.6 支持根据 changelog 自定义可分解分数。我不知道如何使用它。我试过 net <- hc(df, score = "custom"),它给了我 Error in check.custom.score.function(fun = extra.args$fun): missing the custom score function。任何人都知道如何将自定义函数提供给 hc?

bnlearn:::check.score.args 算出来的。您需要提供一个 fun 参数,例如 net <- hc(df, score = "custom", fun=function(...) ...)。仅供参考,函数签名为 function(node, parents, data, args)