WEAKLEARNER

Produce classifier thresholding single feature.



 Synopsis:
  model = weaklearner(data)

 Description:
  This function produce a weak binary classifier which assigns
  input vector x to classes [1,2] based on thresholding a single 
  feature. The output is a model which defines the threshold 
  and feature index such that the weighted error is minimized.
  This weak learner can be used with the AdaBoost classifier
  (see 'help adaboost') as a feature selection method.
  
 Input:
  data [struct] Training data:
   .X [dim x num_data] Training vectors.
   .y [1 x num_data] Binary labels (1 or 2).
   .D [1 x num_data] Weights of training vectors (optional).
    If not given then D is set to be uniform distribution.
 
 Output:
  model [struct] Binary linear classifier:
   .W [dim x 1] Normal vector of hyperplane.
   .b [1x1] Bias of the hyperplane.
   .fun = 'linclass'.

 Example:
  help adaboost

 See also: 
  ADABOOST, ADACLASS.
 

Source: weaklearner_fast.m

About: Statistical Pattern Recognition Toolbox
(C) 1999-2004, Written by Vojtech Franc and Vaclav Hlavac
Czech Technical University Prague
Faculty of Electrical Engineering
Center for Machine Perception

Modifications:
31-jan-2007, VF, careful handling the bias value
01-dec-2006, SC, sharat@mit.edu; wrote fast version
25-aug-2004, VF
11-aug-2004, VF