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 * Written (W) 2011 Sergey Lisitsyn 00008 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society 00009 */ 00010 00011 #ifndef MEANSQUAREDERROR_H_ 00012 #define MEANSQUAREDERROR_H_ 00013 00014 #include <shogun/evaluation/Evaluation.h> 00015 #include <shogun/features/Labels.h> 00016 00017 namespace shogun 00018 { 00019 00020 class CLabels; 00021 00033 class CMeanSquaredError: public CEvaluation 00034 { 00035 public: 00037 CMeanSquaredError() : CEvaluation() {}; 00038 00040 virtual ~CMeanSquaredError() {}; 00041 00047 virtual float64_t evaluate(CLabels* predicted, CLabels* ground_truth); 00048 00049 inline EEvaluationDirection get_evaluation_direction() 00050 { 00051 return ED_MINIMIZE; 00052 } 00053 00055 virtual inline const char* get_name() const { return "MeanSquaredError"; } 00056 }; 00057 00058 } 00059 00060 #endif /* MEANSQUAREDERROR_H_ */