00001 // @(#)root/tmva $Id: MisClassificationError.cxx 29122 2009-06-22 06:51:30Z brun $ 00002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss 00003 00004 /********************************************************************************** 00005 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00006 * Package: TMVA * 00007 * Class : MisClassificationError * 00008 * Web : http://tmva.sourceforge.net * 00009 * * 00010 * Description: Implementation of the MisClassificationError as separation * 00011 * criterion: 1-max(p, 1-p) as 00012 * * 00013 * Authors (alphabetical): * 00014 * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland * 00015 * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany * 00016 * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada * 00017 * * 00018 * Copyright (c) 2005: * 00019 * CERN, Switzerland * 00020 * U. of Victoria, Canada * 00021 * Heidelberg U., Germany * 00022 * * 00023 * Redistribution and use in source and binary forms, with or without * 00024 * modification, are permitted according to the terms listed in LICENSE * 00025 * (http://tmva.sourceforge.net/LICENSE) * 00026 **********************************************************************************/ 00027 00028 //_______________________________________________________________________ 00029 // 00030 // Implementation of the MisClassificationError as separation criterion 00031 // 00032 //_______________________________________________________________________ 00033 00034 00035 #include "TMVA/MisClassificationError.h" 00036 00037 ClassImp(TMVA::MisClassificationError) 00038 00039 //_______________________________________________________________________ 00040 Double_t TMVA::MisClassificationError::GetSeparationIndex( const Double_t &s, const Double_t &b ) 00041 { 00042 // Misclassifiacton error criterion: 1-max(p, 1-p) (p: purity= s/(s+b)) 00043 if ( s+b <= 0) return 0; 00044 00045 Double_t p = s/(s+b); 00046 if (p >= 1-p) return 1-p; 00047 else return p; 00048 } 00049 00050