best constant for all loss functions

This pull request adds a functionality of getting best constant and best constant loss values for all loss functions currently supported by VW. Code is moved to a separate file (best_constant.cc) to keep main.cc small.
More details can be found here:
https://github.com/JohnLangford/vowpal_wabbit/issues/406#issuecomment-63278712

Pls note that there are no any changes to VS project files or makefiles. So it will break VW build process as main.cc will be dependant on best_constant.cc till someone add best_constant.cc to list of project files  for compilation. Unfortunately I have no VS to make these changes and include them in pull request. 
I read through the patch.  Everything makes since, except for disabling
best constant sometimes.  Why should it be disabled when using nn? new_mf?
These are representational choices rather than problem type choices, so it
seems a best constant should be calculable.

-John

On Tue, Nov 18, 2014 at 4:38 PM, Alexander Trufanov <
notifications@github.com> wrote:

> In vowpalwabbit/best_constant.cc:
>
> > +
> > +    po::variables_map vm = po::variables_map();
> > +
> > +    po::store(pos, vm);
> > +    po::notify(vm);
> > +
> > +    if (vm.count("nn") || vm.count("new_mf") || all.rank > 0
> > +            || vm.count("oaa") ||   vm.count("log_multi") || vm.count("csoaa_ldf")
> > +            || vm.count("wap_ldf")  || vm.count("csoaa") || vm.count("ect")
> > +            || vm.count("cb") || vm.count("cbify") || vm.count("search")) return false;
> > +
> > +    string funcName;
> > +    if(vm.count("loss_function"))
> > +        funcName = vm["loss_function"].as<string>();
> > +    else
> > +        funcName = "squaredloss";
>
> yes, looks like count() is always > 0 for options with default values.
> I'll change "squaredloss" -> "squared" in my piece just in case someone
> removes default log_loss value in parse_args.cc. You can fix it in
> parse_args.cc.
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/JohnLangford/vowpal_wabbit/pull/445/files#r20540317>.
>