Cpp ML Library
1.0.0
A library of Machine Learning Algorithmns seen from the Udemy course Machine Learning A to Z.
|
Class to perform frequent itemset mining using the Apriori algorithm. More...
#include <Apriori.hpp>
Public Member Functions | |
Apriori (double min_support) | |
Constructor for the Apriori class. More... | |
std::vector< std::set< int > > | run (const std::vector< std::vector< int >> &transactions) |
Runs the Apriori algorithm on the provided dataset. More... | |
std::unordered_map< std::string, int > | get_support_counts () const |
Gets the support counts for all frequent itemsets found. More... | |
std::string | itemset_to_string (const std::set< int > &itemset) const |
Converts an itemset to a string representation for use as a key. More... | |
Class to perform frequent itemset mining using the Apriori algorithm.
Apriori::Apriori | ( | double | min_support | ) |
Constructor for the Apriori class.
min_support | Minimum support threshold (as a fraction between 0 and 1). |
std::unordered_map< std::string, int > Apriori::get_support_counts | ( | ) | const |
Gets the support counts for all frequent itemsets found.
std::string Apriori::itemset_to_string | ( | const std::set< int > & | itemset | ) | const |
Converts an itemset to a string representation for use as a key.
itemset | The itemset to convert. |
std::vector< std::set< int > > Apriori::run | ( | const std::vector< std::vector< int >> & | transactions | ) |
Runs the Apriori algorithm on the provided dataset.
transactions | A vector of transactions, each transaction is a vector of items. |