Description
Happycoders datamining C++ library implements public datamining algorithms.
It provides an implementation of ID3, CART and C4.5 datamining algorithms.
Theses algorithms generate decision trees that can be used to classify data.
This library is released under the term of the GNU LGPL licence.
Features
- provides libdata : generic library to manipulate generic
data (csv, database via ODBC)
- implement ID3 algorithm
- implement CART algorithm
- implement C4.5 algorithm
- implement CHAID algorithm (not yet released)
- all algorithms have the same API (changing the algorithm only takes a few
seconds)
Installation
Doxygen Documentation
Doxygen documentation is available here .
Example
int main(int argc, char **argv)
{
Data::CsvLoader loader;
if (argc < 4)
{
std::cerr << "Usage : " << argv[0]
<< " filename.csv separator_character "
<< "col_classification_result_name"
<< std::endl;
exit (1);
}
try
{
std::string filename(argv[1]);
std::vector<unsigned int> learning;
std::string col_name(argv[3]);
std::vector<Data::Column*> cols;
cols = loader.read_file(filename, argv[2][0]);
for (unsigned int i = 0; i < cols[0]->get_size() / 2; i++)
learning.push_back(i);
Algo::CART cart(cols, learning, col_name);
cart.construct_tree();
std::cout << cart.get_tree() << std::endl;
}
catch (Exception::Exception e)
{
std::cerr << e;
exit (1);
}
return 0;
}
|