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 ////////////////////////////////////////////////////////////////////////////////
26 class MappingApproximer {
27 int _max_nb_weak_learners, _nb_weak_learners;
29 scalar_t *_thresholds;
31 int _input_size, _nb_samples;
32 scalar_t *_input, *_sample_weights;
33 int *_input_sorted_index;
35 scalar_t *_outputs_on_samples;
36 MappingApproximer(int size);
38 void load(istream &is);
39 void save(ostream &os);
40 void set_learning_input(int input_size, int nb_samples, scalar_t *input, scalar_t *sample_weights);
41 void learn_one_step(scalar_t *target);
42 scalar_t predict(scalar_t *input);
45 void test_approximer();