00001 #ifndef GraphSegmentation_H 00002 #define GraphSegmentation_H 00003 00004 #include <TeAdoDB.h> 00005 #include <TeDatabase.h> 00006 #include "Som.h" 00007 00020 class GraphSegmentation { 00021 public: 00022 00024 GraphSegmentation(){}; 00025 00027 TIntVector Segment( SOM* som, int min_neurons_per_cluster ); 00028 00029 Value_Type Davies_Bouldin( Value_Type p, Value_Type q ); 00030 00031 Value_Type Davies_Bouldin_Data( Value_Type p, Value_Type q ); 00032 00034 int getNumClusters() { return _num_clusters; }; 00035 00036 TIntVector Siponen(); 00037 00039 void createField( vector<string> params ); 00040 00041 00042 private: 00043 00044 void Init( SOM* som ); 00045 00047 TMatrix Centroid( ); 00048 00049 TMatrix Distance( ); 00050 00051 TVector Winner( ); 00052 00053 TVector MeanDistance( ); 00054 00055 TMatrix AdjacentNode( ); 00056 00057 Value_Type Hmin( ); 00058 00059 void Label( int i, int& group, TIntVector& vec, bool& changed ); 00060 00061 00062 private: 00063 SOM * _som; 00064 00065 TMatrix _adjacentNode; 00066 TMatrix _distance; 00067 TVector _winner; 00068 TVector _meanDistance; 00069 TMatrix _centroid; 00070 00071 Value_Type _Hmin; 00072 Value_Type _delta; 00073 int m; 00074 00075 TIntVector _clusters; 00076 TVector _S; 00077 TMatrix _M; 00078 int _num_clusters; 00079 TIntVector _num_vector_cluster; 00080 TMatrix _cluster_centroid; 00081 TMatrix _R; 00082 00083 }; 00084 00085 00086 #endif