rk7
rk7

Reputation: 65

Scikit-learn using Naive Bayes for multiclass classification with 10 fold cross validation

I am trying to use the Naive Bayes classifier in sklearn for multi-class classification. I want to obtain the scores using 10-fold cross-validation. Assuming that x is my feature array and y is the label vector, I am doing this:

    clf = MultinomialNB(fit_prior=False)
    scores = cross_validation.cross_val_score(OneVsOneClassifier(clf), x, y, cv=10)

But this just gives me an array of 10 scores for each of the folds. What I want is the score for each pair of classes from the OvO classifier. Any suggestions on how to do this?

Also is there any way we can use a customized smoothing technique for the NB classifier?

Upvotes: 0

Views: 1428

Answers (1)

Fred Foo
Fred Foo

Reputation: 363828

What I want is the score for each pair of classes from the OvO classifier.

Unfortunately, the OvO wrapper currently doesn't have a public API to get to these scores.

Also is there any way we can use a customized smoothing technique for the NB classifier?

No, Lidstone smoothing is currently the only option.

Upvotes: 1

Related Questions