diff options
-rw-r--r-- | vowpalwabbit/scorer.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/vowpalwabbit/scorer.cc b/vowpalwabbit/scorer.cc index ea327895..507c60c1 100644 --- a/vowpalwabbit/scorer.cc +++ b/vowpalwabbit/scorer.cc @@ -34,8 +34,9 @@ namespace Scorer { // http://en.wikipedia.org/wiki/Generalized_logistic_curve // where the lower & upper asymptotes are -1 & 1 respectively - // y = f(x) -> [-1, 1] - float glc1(float in) + // 'glf1' stands for 'Generalized Logistic Function with [-1,1] range' + // y = f(x) -> [-1, 1] + float glf1(float in) { return 2.f / (1.f + exp(- in)) - 1.f; } @@ -53,7 +54,7 @@ namespace Scorer { po::options_description link_opts("Link options"); link_opts.add_options() - ("link", po::value<string>()->default_value("identity"), "Specify the link function: identity, logistic or glc1"); + ("link", po::value<string>()->default_value("identity"), "Specify the link function: identity, logistic or glf1"); vm = add_options(all, link_opts); @@ -71,11 +72,11 @@ namespace Scorer { l->set_learn<scorer, predict_or_learn<true, logistic> >(); l->set_predict<scorer, predict_or_learn<false, logistic> >(); } - else if (link.compare("glc1") == 0) + else if (link.compare("glf1") == 0) { - all.file_options.append(" --link=glc1 "); - l->set_learn<scorer, predict_or_learn<true, glc1> >(); - l->set_predict<scorer, predict_or_learn<false, glc1> >(); + all.file_options.append(" --link=glf1 "); + l->set_learn<scorer, predict_or_learn<true, glf1> >(); + l->set_predict<scorer, predict_or_learn<false, glf1> >(); } else { |