machine learning - How to use the OneVsRestClassifier in Scikit-learn to analyse the performance of predicting each individual class with multi-class classification? -
in onevsrestclassifier documentation on scikit-learn website states following:
"since each class represented 1 , 1 classifier only, possible gain knowledge class inspecting corresponding classifier."
but gives no explanation of how , can't see how of methods in documentation on page achieve that. want able print out accuracy of model each individual class, can see performance has @ predicting each class.
the code have far below, don't know go here, seems there nothing in documentation, explains how this. appreciated.
def predict_one_vs_rest(self): clf = onevsrestclassifier(linearsvc(random_state=0)) clf.fit(self.x, self.y) result = clf.classes_ estimators = clf.estimators_ print(result) print("") print(estimators)
you don't need wrap linearsvc in onevsrestclassifier. documentation says, linearsvc supports multi-class classification. inspecting accuracy of classes, use confusion matrix or classification report, example.
Comments
Post a Comment