/*
  File name: bagging.h
  Created by: Ljubomir Buturovic
  Created: 10/22/2002
  Purpose: declarations for bagging methods in bagging.c.
*/

/*
  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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include "mlp.h"
#include "lau.h"
#include "pau.h"


/*
  Train a combined classifier using 'bagging' algorithm described in:
  Amanda J. C. Sharkey (Ed.), Combining Artificial Neural Nets,
  Chapter 2, Sections 2.2.2 and 3.2. Springer, London, 1999. 'nmodels'
  is the number of classifiers used for bagging; 'bag_size' is the
  size of each sampling dataset used to build an individual
  classifier.

  Return array of 'nmodels' classifier structs (one per sampling
  dataset), representing the bagging classifier. The function stores
  the classifier in file 'fname'. In case of error, return NULL and
  set 'errc'.

  The 'problems' argument is specific to SVM bagging. It returns the
  set of SVM svm_problems structures used to build the bagging
  classifier, for subsequent free()-ing. The reason that the
  structures are not free()-ed here is that the returned models
  reference them, so the free() can only be done by the caller once
  the models are no longer needed.

  This function has been reimplemented as pcl_svm_learn() for SVM
  classifiers, and put into libpcl.a library, for external
  use. Consider reimplementing bagging for all classifiers in such
  manner.
*/
void **bagging(struct dataset *dset, FILE *outdev, int method, char *fname,
	       unsigned int seed, int nmodels, int bag_size, void *options,
	       void ***problems, int *errc, FILE *fdbg);



syntax highlighted by Code2HTML, v. 0.9.1