4 #include <lemon/list_graph.h>
6 #include "../base/streamingalgorithm.h"
7 #include "../base/inputsetter.h"
8 #include "../base/dissimilaritymeasure.h"
9 #include "../base/solutionprovider.h"
10 #include "../base/partitionprovider.h"
11 #include "../datastructure/partitionsolution.h"
12 #include "../clustering/cftree.h"
13 #include "../clustering/birchconfig.h"
64 cft(config->euclidianProvider, config->clusterDistanceMeasure, config->thresholdAttribute, &tfr,
65 config->innerBranching, config->leafBranching, config->threshold, config->maxSize)
74 std::vector<CFEntry<T> > entries = cft.leafEntries();
75 std::vector<CFEntry<T>*> entriesPointer;
76 for(
typename std::vector<
CFEntry<T> >::iterator it = entries.begin(); it != entries.end(); ++it)
77 entriesPointer.push_back(&(*it));
78 Algorithm* alg3 = config->phase3(&entriesPointer);
82 std::vector<std::vector<CFEntry<T>*> > partitions = alg3part->
clustering(0);
84 std::vector<T*> features;
85 for(
typename std::vector<std::vector<
CFEntry<T>*> >::iterator it1 = partitions.begin(); it1 != partitions.end(); ++it1)
88 for(
typename std::vector<
CFEntry<T>*>::iterator it2 = it1->begin(); it2 != it1->end(); ++it2)
90 features.push_back(
new T((1/cog->
number) * cog->
LS));
94 Algorithm* alg4 = config->phase4(&features);
100 std::vector<std::vector<std::vector<T*> > > solvec;
102 for(
unsigned int i = 0; i < max; i++)
108 for(
typename std::vector<T*>::iterator it = features.begin(); it != features.end(); ++it)
std::vector< std::vector< std::vector< T * > > > partitions
BIRCH configuration class.
BirchConfig< T > const * config
virtual double operator()(double t)
BIRCH clustering algorithm.
size_t number
Number of points contained in the feature.
virtual double calcNewThreshold(double oldThreshold) const =0
Returns the new threshold for rebuilding the clustering feature tree.
virtual PartitionSolution< T > * compute()
Runs the algorithm and returns the computed solution.
Birch(BirchConfig< T > const *config)
BirchConfig< T > const * config
ThreshFuncRedirector(BirchConfig< T > const *config)
virtual std::vector< std::vector< T * > > clustering(unsigned int solutionIndex) const =0
Returns the specified clustering as a vector of vector of pointers to the elements.
virtual SolutionProvider * compute()=0
Runs the algorithm and returns the computed solution.
Abstract base class for algorithms.
virtual Birch< T > & operator<<(T const &element)
Streaming operator.
Abstract base class to access results of partition based clustering algorithms.
virtual unsigned int number_of_solutions() const =0
returns the number of available solutions
Abstract base class for streaming algorithms.
Clustering feature tree entry.
Abstract base class for algorithm solutions.
Data structure for partitions.
Wraps around a BirchConfig object to provide threshold calculation.