Completed
Push — 0.7.dev ( b54fcd...1a41c1 )
by Andrei
01:19
created

kmeans_plusplus_initializer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 6 1
A __init__() 0 3 1
1
import random;
2
3
4
class random_center_initializer:
5
    def __init__(self, data, amount_centers):
6
        self.__data = data;
7
        self.__amount = amount_centers;
8
9
10
    def initialize(self):
11
        return [ self.__create_center() for _ in range(len(self.__amount)) ];
12
13
14
    def __create_center(self):
15
        return [ random.random() for _ in range(len(self.__data[0])) ];
16
17
18
class kmeans_plusplus_initializer:
19
    def __init__(self, data, amount_centers):
20
        self.__data = data;
21
        self.__amount = amount_centers;
22
23
24
    def initialize(self):
25
        """
26
        kmeans++ method for center initialization;
27
        
28
        """
29
        return None;