#ifndef RANDOMFOREST_H
#define RANDOMFOREST_H

#include "decisiontree.h"


/**
 * @brief The RandomForest class holds fucntions for RandomForest algoritm
 * @autor Jakub Srom
 * @required decisiontree.h
 */
class RandomForest:public DecisionTree
{
public:
    RandomForest(std::map <std::string, double> classes, std::vector <std::string> head);

    std::vector<std::string> Train(std::vector < std::vector<std::string> > Data, int numberOfTrees, unsigned int kValue);

    std::vector <std::string> Classify(std::vector < std::vector<std::string> > test, std::vector<std::string> Tree, int numberOfTrees);

private:

    std::vector <std::string> Tree;

    std::map <std::string, double> cls;
    std::vector <std::string> header;

    void makeTree(std::map<std::string, double> firstColumn, std::vector < std::vector<std::string> > Data, int column, std::string maxS, int kValue);

    std::string findClassInTree(std::vector < std::vector<std::string> > test, int pomHeader, int pomTree, std::string val, std::vector <std::string> TreeLocal);

};

#endif // RANDOMFOREST_H
