Biorithm
1.1
|
This class takes an input stream of a matrix data file and analyzes the the independence of the columns. More...
#include <HPosMiner.h>
Public Member Functions | |
HPosMiner (float balance=0.5, float support=1.0, unsigned int buffer_size=1000) | |
HPosMiner (const HPosMiner &src) | |
virtual | ~HPosMiner () |
virtual HPosMiner & | operator= (const HPosMiner &rhs) |
Protected Member Functions | |
void | analyzeHelper () |
virtual bool | analyzeLevel (unsigned int level) |
virtual void | analyzeFirstLevel () |
virtual void | analyzeNewLevel (unsigned int level) |
virtual void | countTable (unsigned int level, unsigned int length) |
virtual bool | hasMatches (hm_citer i, hm_citer j, unsigned int level) |
virtual void | pruneItemSets (const vector< unsigned int > &tallies, unsigned int level) |
virtual unsigned int | handlePrinting (unsigned int level) |
virtual void | analyzeItemSet (const ItemSet &is, const ItemSet &ispos, const ItemSet &isneg, unsigned int &penalty, unsigned int &success) const |
virtual void | analyzeItemSet (const ItemSet &is, unsigned int &penalty, unsigned int &success) const |
int | gensupp (const ItemSet &ispos, const ItemSet &isneg, unsigned int start) const |
void | setcode (const ItemSet &is, unsigned int code) |
void | setcode (unsigned int code) |
Protected Attributes | |
unsigned int | current |
float | balance |
unsigned int | bpreq |
unsigned int | bpreq2 |
float | support |
vector< ItemSet > | buffer |
unsigned int | buffer_size |
LevItemSetMap< struct hassoc > | keepSets |
This class takes an input stream of a matrix data file and analyzes the the independence of the columns.
HPosMiner::HPosMiner | ( | float | balance = 0.5 , |
float | support = 1.0 , |
||
unsigned int | buffer_size = 1000 |
||
) |
The Pos TruthFinder
Notes about keepSets: Each itemset has an associated value. 0: There can be no further candidates, this is definitly part of the positive border. 1: Before counting the table, there may be further derivations. After counting the table, there were no further derivations, this is a part of the positive border. 2: There was a successful derivation. This is not a part of the positive border.
------------------------------- Parameters ------------------------------- float balance The minimum fraction of rows that must comprise a bitpattern float support The fraction of bitpatterns that have to succeed at each level unsigned int buffer_size the amount of combinations allowed to sit in the queue at once
HPosMiner::HPosMiner | ( | const HPosMiner & | src | ) |
HPosMiner::~HPosMiner | ( | ) | [virtual] |
Destructor
void HPosMiner::analyzeFirstLevel | ( | ) | [protected, virtual] |
Analyzes level one. Because we have not had candidates until this point, it has to generate the single column "combinations" for each column
void HPosMiner::analyzeHelper | ( | ) | [protected, virtual] |
Analyzes the matrix, one level at a time
--------------------------------- Return --------------------------------- An error message
Reimplemented from LevelwiseMiner.
bool HPosMiner::analyzeLevel | ( | unsigned int | level | ) | [protected, virtual] |
Analyzes a single level
------------------------------- Parameters ------------------------------- unsigned int level The current level
--------------------------------- Return --------------------------------- Whether or not we should continue (whether or not any matches were found)
Implements LevelwiseMiner.
void HPosMiner::analyzeNewLevel | ( | unsigned int | level | ) | [protected, virtual] |
Analyzes any level other than the first one
------------------------------- Parameters ------------------------------- unsigned int level The current level
void HPosMiner::countTable | ( | unsigned int | level, |
unsigned int | length | ||
) | [protected, virtual] |
Counts out the truth tables at this level, given a set of column combinations
------------------------------- Parameters ------------------------------- vector<ItemSet*>& buffer The buffer of ItemSets that we need to analyze LevItemSetMap<struct assoc>& result The table to store all the succeeding combimations in unsigned int level The current level unsigned int length The number of combinations sitting in the buffer
unsigned int HPosMiner::handlePrinting | ( | unsigned int | prevlevel | ) | [protected, virtual] |
Handle printing
------------------------------- Parameters ------------------------------- unsigned int level The current level
--------------------------------- Return --------------------------------- The level count
bool HPosMiner::hasMatches | ( | hm_citer | i, |
hm_citer | j, | ||
unsigned int | level | ||
) | [protected, virtual] |
At this point we have found two matching sets (Two sets of width w, where only one element differs in each) Now we need to see if the other elements exist
------------------------------- Parameters ------------------------------- const ItemSet* i The first item set const ItemSet* j The second item set unsigned int level The current level
--------------------------------- Return --------------------------------- Whether or not all the matches are found
void HPosMiner::pruneItemSets | ( | const vector< unsigned int > & | tallies, |
unsigned int | level | ||
) | [protected, virtual] |
Prunes out itemsets based on bitpattern counts
------------------------------- Parameters ------------------------------- vector<ItemSet*>& buffer The buffer of ItemSets that we are evaluating LevItemSetMap& result The table to store all the succeeding combimations in const vector<vector<unsigned int> >& tallies) The tally sheet of bitpattern counts unsigned int level The current level