#ifndef ID3_H
#define ID3_H

#include "decisiontree.h"

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

    std::vector<std::string> Train(std::vector < std::vector<std::string> > Data);

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

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);

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

};

#endif // ID3_H
