我正在尝试使用RandomForestClassifer
来复现这个例子。
我不知道如何转换代码的这一部分。
# Learn to predict each class against the other
classifier = OneVsRestClassifier(svm.SVC(kernel='linear', probability=True,
random_state=random_state))
y_score = classifier.fit(X_train, y_train).decision_function(X_test)
我尝试过
# Learn to predict each class against the other
classifier = OneVsRestClassifier(RandomForestClassifier())
y_score = classifier.fit(X_train, y_train).decision_function(X_test)
但我得到了
属性错误:基础估计器没有decision_function属性。
有解决方法吗?