bnlearn中的错误:变量有5个级别,但是我得到了错误"变量arb_review必须至少有两个级别。"

时间:2017-03-28 06:27:06

标签: r bayesian-networks bnlearn

我的数据由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.

0 个答案:

没有答案