SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
RandomSearchModelSelection.h
Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Copyright (C) 2011 Heiko Strathmann
00008  * Copyright (C) 2012 Sergey Lisitsyn
00009  */
00010 
00011 #ifndef RANDOMSEARCHMODELSELECTION_H_
00012 #define RANDOMSEARCHMODELSELECTION_H_
00013 
00014 #include <shogun/modelselection/ModelSelection.h>
00015 #include <shogun/base/DynArray.h>
00016 
00017 namespace shogun
00018 {
00019 class CModelSelectionParameters;
00020 
00024 class CRandomSearchModelSelection : public CModelSelection
00025 {
00026 public:
00028     CRandomSearchModelSelection();
00029 
00036     CRandomSearchModelSelection(CMachineEvaluation* machine_eval,
00037             CModelSelectionParameters* model_parameters, float64_t ratio);
00038 
00040     virtual ~CRandomSearchModelSelection();
00041 
00046     float64_t get_ratio() const { return m_ratio; }
00047 
00052     void set_ratio(float64_t ratio)
00053     {
00054         REQUIRE(ratio>0.0 && ratio<1.0, "Ratio should be in [0,1] range\n")
00055         m_ratio=ratio;
00056     }
00057 
00064     virtual CParameterCombination* select_model(bool print_state=false);
00065 
00067     virtual const char* get_name() const { return "RandomSearchModelSelection"; }
00068 
00069 protected:
00071     float64_t m_ratio;
00072 };
00073 }
00074 #endif /* RANDOMSEARCHMODELSELECTION_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation