ECOCPAK v0.9
fn_construct_classifier.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2011 the authors listed below
00002 // http://ecocpak.sourceforge.net
00003 //
00004 // Authors:
00005 // - Dimitrios Bouzas (bouzas at ieee dot org)
00006 // - Nikolaos Arvanitopoulos (niarvani at ieee dot org)
00007 // - Anastasios Tefas (tefas at aiia dot csd dot auth dot gr)
00008 //
00009 // This file is part of the ECOC PAK C++ library. It is
00010 // provided without any warranty of fitness for any purpose.
00011 //
00012 // You can redistribute this file and/or modify it under
00013 // the terms of the GNU Lesser General Public License (LGPL)
00014 // as published by the Free Software Foundation, either
00015 // version 3 of the License or (at your option) any later
00016 // version.
00017 // (see http://www.opensource.org/licenses for more info)
00018 
00019 
00022 
00023 
00037 Classifier*
00038 construct_classifier
00039   (
00040   const mat& A,
00041   const mat& B,
00042   const int classifiers_type
00043   )
00044   {
00045 
00046   // construct classifier A vs B according to type
00047   switch(classifiers_type)
00048     {
00049     // Nearest Class Centroid Classifier
00050     case NCC:
00051       {
00052       return new Classifier_ncc(A, B);
00053       }
00054 
00055     // Fisher Linear Discriminant followed by NCC
00056     case FLDA:
00057       {
00058       return new Classifier_flda(A, B);
00059       }
00060 
00061     // Support Vector Machine Classifier
00062     case SVM:
00063       {
00064       return new Classifier_svm(A, B);
00065       }
00066 
00067     // AdaBoost Classifier
00068     case ADABOOST:
00069       {
00070       return new Classifier_adaBoost(A, B);
00071       }
00072 
00073     // Sum of Error Squares Classifier
00074     case LEAST_SQUARES:
00075       {
00076       return new Classifier_ls(A, B);
00077       }
00078 
00079     // Custom Classifier
00080     case CUSTOM_CLASSIFIER:
00081       {
00082       return new Classifier_custom(A, B);
00083       }
00084 
00085     default:
00086       {
00087       arma_debug_print("construct_classifier(): Unknown classifier's option");
00088       }
00089 
00090     }
00091 
00092   }
00093 
00094 
00095 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerator Defines