Skip to content

Getting SVM minimized function value

1 message · David Meyer

#
Pau,

the objective value currently is not returned by libsvm; I will drop
Chih-Chen Lin, the author of libsvm, a note on that (it's actually not much
of a work).

However, the C-code can create some debugging output which includes the
objective value, so at least you can get it on the screen. Therefore, you
need to activate a "switch" in src/svm.cpp in the package sources. Almost at
the beginning of the file, you will find:


#if 0
void info(char *fmt,...)
{
        va_list ap;
        va_start(ap,fmt);
        vprintf(fmt,ap);
        va_end(ap);
}
void info_flush()
{
        fflush(stdout);
}
#else
void info(char *fmt,...) {}
void info_flush() {}
#endif

Just change the 

#if 0

to 

#if 1

and re-build + re-install the package.

HTH,
David

------------------------

Hello, I have been searching a way to get the resulting optimized
function value of a trained SVM model (svm from the package e1071) but
I have not succeed.
Does anyone knows a way to get that value?
Pau