I am using LIBSVM package (Matlab version) in order to perform wind power forecasting. My training dataset is quite big, approx. 52000 values of 4 parameters.

The code seems to run correctly but is quite slow and I get the following message:

WARNING: using -h 0 may be faster

What does that mean and what do I have to change in my code?

  • 1
    $\begingroup$ Add the -h 0 flag to your options string. Basically it means that no shrinking heuristics will be used by the solver. $\endgroup$ Sep 17 '13 at 11:38

This means, that optimization algorithm detected that with high probability (not in the strict, mathematical sense) you can speed up your training by turning the -h 0 flag in your options. Basically, -h is the shrinking heuristics, implemented in the libsvm package which for some data significantly reduces number of required computations, while in others - makes it slower. There is no general rule, but there are some heuristics regarding this heuristic, which "detect" when it could help - and this is exactly the reason for this message - one of such "metaheuristics" detected, that for your particular data and parameters - it could be more valuable to set the -h 0 flag.

If you are interested in more details regarding this possible optimization speed up you could refer to the source paper:

T. Joachims, Transductive Inference for Text Classification using Support Vector Machines. International Conference on Machine Learning (ICML), 1999.

  • $\begingroup$ For folks (like me) reading this and using sklearn, use shrinking=False. $\endgroup$
    – dmn
    Apr 16 '21 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.