/* File name: adaboost.h Created by: Ljubomir Buturovic Created: 09/19/2002 Purpose: declarations for adaboost.c, an implementation of Adaboost algorithm for pattern classification. */ /* Copyright 2004 Ljubomir J. Buturovic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "pcp.h" int boosting_nmodels(FILE *indev, FILE *outdev); /* Train a classifier on 'dset', using AdaBoost algorithm and 'method'. Optional parameters for 'method' are expected to be placed in 'options', which should be pointer to a structure of the method-specific parameters. Return array of 'nmodels' weighted classifiers, with weights in 'weights'. The function saves the resulting classifier in 'fname'. The function implements the logic and follows notation of: Amanda J. C. Sharkey (Ed.), Combining Artificial Neural Nets, Chapter 2, Combining Predictors, Section 2.5.1. Springer, London, 1999. In case of error, return NULL and set 'errc'. Possible errors are: malloc() errors; mlp_learn() errors (for method == PALG_MLP); svm_train() errors (for method == PALG_SVM). */ void **adaboost(struct dataset *dset, int method, int *nmodels, float **weights, char *fname, unsigned int seed, void *options, int *errc, FILE *fdbg); /* Accept input parameters and pass them to adaboost learning function adaboost(). The function provides Adaboost driver for two learning algorithms, MLP (*method == PALG_MLP) and SVM (*method == PALG_SVM). The resulting classifier is saved in user-provided file 'fname'. In case of error, set 'errc'. If error is file access error, set 'xname'. */ void p_boost_learn(int *method, int *errc, char **xname, int *dbg);