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

kmeans_plusplus_initializer.__init__()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
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;