How to obtain the training error in svm of Scikit-learn?
问题 My question: How do I obtain the training error in the svm module (SVC class)? I am trying to do a plot of error of the train set and test set against the number of training data used ( or other features such as C / gamma ). However, according to the SVM documentation , there is no such exposed attribute or method to return such data. I did find that RandomForestClassifier does expose a oob_score_ though. 回答1: Just compute the score on the training data: >>> model.fit(X_train, y_train).score