Git Product home page Git Product logo

Comments (6)

kousu avatar kousu commented on August 11, 2024

!
That's very interesting. I just stumbled across a similar issue with svm.cpp, but it seems to be the reverse problem there: probability predictions are correct, non-probability predictions are always the same class, but only on certain datasets. I documented it at scikit-learn/scikit-learn#4800

from libsvm.

cjlin1 avatar cjlin1 commented on August 11, 2024

There is no problem there. Even if the max num is reached, we still
need to return A and B. The if statement prints just a warning message.

mahan66 writes:

If anybody wants to use the probability outputs of the svm, it goes wrong and the
output label is always the same. The problem is in the line 1672:

if (iter>=max_iter)
//svm.info("Reaching maximal iterations in two-class probability estimates\n");

probAB[0]=A;probAB[1]=B;

As you can see, the next line after the commented part of the if statement will be
fired if the statement in the if is true. Thus, the results are always wrong.

Solution
Simply, put comment for the whole if statement.

Regards,
Mahmood


Reply to this email directly or view it on GitHub.*

from libsvm.

kousu avatar kousu commented on August 11, 2024

I think @mahan66 is pointing out that the comment accidentally changes the meaning. The code should be

if (iter>=max_iter) {
    //svm.info("Reaching maximal iterations in two-class probability estimates\n");
}

probAB[0]=A;probAB[1]=B;

from libsvm.

mricherzhagen avatar mricherzhagen commented on August 11, 2024

Yep. there is definitely a problem. The compiler interprets this as

if (iter>=max_iter) {
    //svm.info("Reaching maximal iterations in two-class probability estimates\n");
    probAB[0]=A;
}

probAB[1]=B;

from libsvm.

cjlin1 avatar cjlin1 commented on August 11, 2024

but right now in svm.java the svm.info statement isn't commented out?
Matthias Richerzhagen writes:

Yep. there is definitely a problem. The compiler interprets this as

if (iter>=max_iter) {
//svm.info("Reaching maximal iterations in two-class probability estimates\n");
probAB[0]=A;
}

probAB[1]=B;


Reply to this email directly or view it on GitHub.*

from libsvm.

mahan66 avatar mahan66 commented on August 11, 2024

Yes, I checked the current source code now and it seems it is correct here. I don't know what version I was using which somebody had made this change.

from libsvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.