Completed
Push — master ( 4556a1...2e36d3 )
by Andrei
01:24
created

antmean   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 2 1
A __init__() 0 8 2
1
"""!
2
3
@brief Cluster analysis algorithm: BIRCH
4
@details Implementation based on article:
5
         - T.Zhang, R.Ramakrishnan, M.Livny. BIRCH: An Efficient Data Clustering Method for Very Large Databases. 1996.
6
         
7
@authors Andrei Novikov, Aleksey Kukushkin ([email protected])
8
@date 2014-2017
9
@copyright GNU Public License
10
11
@cond GNU_PUBLIC_LICENSE
12
    PyClustering is free software: you can redistribute it and/or modify
13
    it under the terms of the GNU General Public License as published by
14
    the Free Software Foundation, either version 3 of the License, or
15
    (at your option) any later version.
16
    
17
    PyClustering is distributed in the hope that it will be useful,
18
    but WITHOUT ANY WARRANTY; without even the implied warranty of
19
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
    GNU General Public License for more details.
21
    
22
    You should have received a copy of the GNU General Public License
23
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
@endcond
25
26
"""
27
28
import pyclustering.core.antmean_wrapper as wrapper
29
30
31
class antmean_clustering_params:
32
    def __init__(self):
33
        
34
        ## used for pheramone evaporation
35
        self.ro                 = 0.9
36
        
37
        ## initial value for pheramones
38
        self.pheramone_init     = 0.1
39
        
40
        ## amount of iterations that is used for solving
41
        self.iterations         = 50
42
        
43
        ## amount of ants that is used on each iteration
44
        self.count_ants         = 20
45
        
46
        
47
class antmean:
48
    def __init__(self, parameters):
49
        
50
        self.__parameters = None
51
        
52
        if (parameters is None):
53
            self.__parameters = antmean_clustering_params();
54
        else:
55
            self.__parameters = parameters;
56
            
57
    
58
    def process(self, count_clusters, samples):
59
        return wrapper.antmean_clustering_process(self.__parameters, count_clusters, samples)
60
        
61