Shark Machine Learning Library
  • About Shark
  • Sourceforge
    • Project Summary
    • Downloads
    • Subversion Repository
  • Getting Started
  • Tutorials
  • FAQ
  • Main Modules
    • ReClaM
    • EALib
    • MOO-EALib
    • Fuzzy
  • Tools
    • Mixture
    • Array
    • Rng
    • LinAlg
    • FileUtil
  • Main Page
  • Related Pages
  • Classes

ClassificationError.h

Go to the documentation of this file.
00001 //===========================================================================
00064 //===========================================================================
00065 
00066 
00067 #ifndef _ClassificationError_H_
00068 #define _ClassificationError_H_
00069 
00070 
00071 #include <ReClaM/ErrorFunction.h>
00072 
00073 
00076 class ClassificationError : public ErrorFunction
00077 {
00078 public:
00080     ClassificationError(double threshold = 0.0);
00081 
00083     ~ClassificationError();
00084 
00085 
00087     double error(Model& model, const Array<double>& input, const Array<double>& target);
00088 
00091     inline double falsePositiveRate()
00092     {
00093         return fpr;
00094     }
00095 
00098     inline double falseNegativeRate()
00099     {
00100         return fnr;
00101     }
00102 
00103 protected:
00104     double threshold;
00105     double fpr;
00106     double fnr;
00107 };
00108 
00109 
00114 class BalancedClassificationError : public ErrorFunction
00115 {
00116 public:
00118     BalancedClassificationError(double threshold = 0.0);
00119 
00121     ~BalancedClassificationError();
00122 
00123 
00140     double error(Model& model, const Array<double>& input, const Array<double>& target);
00141 
00142 protected:
00143     double threshold;
00144 };
00145 
00146 
00153 class ZeroOneLoss : public ErrorFunction
00154 {
00155 public:
00157     ZeroOneLoss();
00158 
00160     ~ZeroOneLoss();
00161 
00162 
00164     double error(Model& model, const Array<double>& input, const Array<double>& target);
00165 };
00166 
00167 
00168 #endif
00169