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) 2012 Jacob Walker 00008 * 00009 * Some code adapted from CrossValidation class by 00010 * Heiko Strathmann 00011 */ 00012 00013 #ifndef CMACHINEEVALUATION_H_ 00014 #define CMACHINEEVALUATION_H_ 00015 00016 #include <shogun/base/SGObject.h> 00017 #include <shogun/evaluation/Evaluation.h> 00018 #include <shogun/evaluation/EvaluationResult.h> 00019 #include <shogun/evaluation/MachineEvaluation.h> 00020 00021 namespace shogun 00022 { 00023 00024 class CMachine; 00025 class CFeatures; 00026 class CLabels; 00027 class CSplittingStrategy; 00028 class CEvaluation; 00029 00034 class CMachineEvaluation: public CSGObject 00035 { 00036 00037 public: 00038 00039 CMachineEvaluation(); 00040 00049 CMachineEvaluation(CMachine* machine, CFeatures* features, CLabels* labels, 00050 CSplittingStrategy* splitting_strategy, 00051 CEvaluation* evaluation_criterion, bool autolock = true); 00052 00060 CMachineEvaluation(CMachine* machine, CLabels* labels, 00061 CSplittingStrategy* splitting_strategy, 00062 CEvaluation* evaluation_criterion, bool autolock = true); 00063 00064 00065 virtual ~CMachineEvaluation(); 00066 00068 EEvaluationDirection get_evaluation_direction(); 00069 00077 virtual CEvaluationResult* evaluate() = 0; 00078 00080 CMachine* get_machine() const; 00081 00084 void set_autolock(bool autolock) { m_autolock = autolock; } 00085 00086 protected: 00087 00089 virtual void init(); 00090 00091 protected: 00092 00094 CMachine* m_machine; 00095 00097 CFeatures* m_features; 00098 00100 CLabels* m_labels; 00101 00103 CSplittingStrategy* m_splitting_strategy; 00104 00106 CEvaluation* m_evaluation_criterion; 00107 00109 bool m_autolock; 00110 00112 bool m_do_unlock; 00113 00114 }; 00115 00116 } /* namespace shogun */ 00117 00118 #endif /* CMACHINEEVALUATION_H_ */