【发布时间】:2021-12-19 04:35:24
【问题描述】:
我注意到我可以在随机森林分类器中设置随机状态,但不能在 Complement Naive Bayes 中设置。我得到错误
TypeError: __init__() got an unexpected keyword argument 'random_state'
我认为这是因为 naive_bayes 正在计算每个类别的概率?
from sklearn.naive_bayes import ComplementNB
model= ComplementNB(random_state=0)
【问题讨论】: