2 ////////////////////////////////////////////////////////////////////////////////
3 // This program is free software; you can redistribute it and/or //
4 // modify it under the terms of the GNU General Public License //
5 // version 2 as published by the Free Software Foundation. //
7 // This program is distributed in the hope that it will be useful, but //
8 // WITHOUT ANY WARRANTY; without even the implied warranty of //
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
10 // General Public License for more details. //
12 // Written and (C) by François Fleuret //
13 // Contact <francois.fleuret@epfl.ch> for comments & bug reports //
14 ////////////////////////////////////////////////////////////////////////////////
16 // $Id: approximer.h,v 1.6 2006-07-22 12:34:11 fleuret Exp $
28 class MappingApproximer {
29 int _max_nb_weak_learners, _nb_weak_learners;
31 scalar_t *_thresholds;
33 int _input_size, _nb_samples;
34 scalar_t *_input, *_sample_weights;
35 int *_input_sorted_index;
37 scalar_t *_outputs_on_samples;
38 MappingApproximer(int size);
40 void load(istream &is);
41 void save(ostream &os);
42 void set_learning_input(int input_size, int nb_samples, scalar_t *input, scalar_t *sample_weights);
43 void learn_one_step(scalar_t *target);
44 scalar_t predict(scalar_t *input);
47 void test_approximer();