我正在使用 creme python 库和 RandomForestClassifier 模型并收到此错误:
AttributeError: 'Multinomial' object has no attribute 'keys'
谁能帮忙?
我的代码:
from creme import stream
from creme.metrics import Accuracy
from creme.tree import RandomForestClassifier
dataset = stream.iter_csv('data/data2.csv', target='HasDetections')
model = RandomForestClassifier()
metric = Accuracy()
for (i, (x, y)) in enumerate(dataset):
preds = model.predict_one(x)
model = model.fit_one(x, y)
metric = metric.update(y, preds)
print("INFO] update {} - {}".format(i, metric))
print("[INFO] final - {}".format(metric))