[Python] Predicting probability

Discussão em 'Python' iniciado por Stack, Março 17, 2025.

  1. Stack

    Stack Membro Participativo

    Trying to use SVC from sklearn to do a classification problem. Given a bunch of data, and information telling me whether some subject is in a certain class or not, I want to be able to give a probability that a new, unknown subject is in a class.

    I only have 2 classes, so the problem is binary. Here is my code and some of my errors

    from sklearn.svm import SVC
    clf=SVC()

    clf=clf.fit(X,Y)


    SVC(probability=True)
    print clf.predict_proba(W) #Error is here


    But it returns the following error:

    NotImplementedError: probability estimates must be enabled to use this method


    How can I fix this?

    Continue reading...

Compartilhe esta Página