1

我的数据由 3 个因子变量组成,每个变量有 5 个级别。 head(swiss_bn,n = 10)

A tibble: 10 × 3
    arb_review blocks  stops
        <fctr> <fctr> <fctr>
1  exploratory  [1,2]  (0,2]
2  exploratory  (3,5]  (0,2]
3  exploratory  (2,3]  (0,2]
4  exploratory  [1,2]  (0,2]
5  exploratory  [1,2]      0
6  exploratory  (3,5]  (2,4]
7  exploratory  (3,5]  (0,2]
8  exploratory  (2,3]  (0,2]
9  disoriented (5,23] (4,18]
10 disoriented (5,23] (4,18]

nlevels(swiss_bn$arb_review)

[1] 5

但是当我跑步时

library(bnlearn)
hc(swiss_bn)

我收到以下错误

Error in check.data(x) : variable arb_review must have at least two levels.
4

0 回答 0