#ifndef _NICE_OBJREC_GENERICGPMODELSELECTION_INCLUDE
#define _NICE_OBJREC_GENERICGPMODELSELECTION_INCLUDE

#include <vector>
#include <string>

#include "GPMSCLooEstimates.h"


namespace OBJREC
{

class GenericGPModelSelection
{
  public:

    static GPMSCLooLikelihoodRegression *selectModelSel ( const NICE::Config *conf, std::string modelselcrit_s )
    {
      GPMSCLooLikelihoodRegression *modelselcrit = NULL;

      if ( modelselcrit_s == "loo_pred_prob_weighted" )
      {
        modelselcrit = new GPMSCLooLikelihoodRegression ( true );
      }
      else if ( modelselcrit_s == "loo_pred_prob" )
      {
        modelselcrit = new GPMSCLooLikelihoodRegression ( false );
      }
      else if ( modelselcrit_s == "loo_pred_squash_opt" )
      {
        modelselcrit = new GPMSCLooLikelihoodClassification ( );
      }
      else if ( modelselcrit_s == "loo_pred_squash" )
      {
        modelselcrit = new GPMSCLooLikelihoodClassificationFixed ( );
      }
      else if ( modelselcrit_s == "loo_recognition_rate" )
      {
        modelselcrit = new GPMSCLooVarious ( GPMSCLooVarious::P_RECOGNITIONRATE );
      }
      else if ( modelselcrit_s == "loo_auc" )
      {
        modelselcrit = new GPMSCLooVarious ( GPMSCLooVarious::P_AUC );
      }
      else if ( modelselcrit_s == "loo_avgprec" )
      {
        modelselcrit = new GPMSCLooVarious ( GPMSCLooVarious::P_AVGPREC );
      }
      else
      {
        fthrow ( NICE::Exception, "Model selection criterion unknown " << modelselcrit_s << " not (yet) supported." << std::endl <<
                 "(genericGPModelSelection.h contains a list of classifiers to choose from)" );
      }

      return modelselcrit;
    }

};

}

#endif
