/** 
 * @file RegressionTreeBuilder.h
 * @brief build regression trees
 * @author Sven Sickert
 * @date 06/19/2013

*/
#ifndef REGRESSIONTREEBUILDERINCLUDE
#define REGRESSIONTREEBUILDERINCLUDE

#include <map>
#include <set>

#include "core/basics/triplet.h"

#include "core/vector/VectorT.h"
#include "core/vector/VVector.h"

#include "vislearning/regression/randomforest/RegressionNode.h"
#include "vislearning/regression/randomforest/RegressionTree.h"


namespace OBJREC {

/** build regression trees */
class RegressionTreeBuilder
{

  protected:

  public:
  
    /** simple constructor */
    RegressionTreeBuilder();
          
    /** simple destructor */
    virtual ~RegressionTreeBuilder();
        
    virtual RegressionNode *build ( const NICE::VVector & x,
          const NICE::Vector & y ) = 0;

    void collectFeatureValues(const NICE::VVector & x,
          const std::vector<int> & selection,
          const int f,
          std::vector< std::pair< double, int > > & values );

    void build ( RegressionTree & tree, 
          const NICE::VVector & x,
          const NICE::Vector & y );

};


} // namespace

#endif