Passed
Push — dev ( 3c73d5...40dcc8 )
by Konstantinos
01:24
created

TabularRetriever.get_numerical_attributes()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
from abc import ABCMeta, abstractmethod, ABC
2
3
__all__ = ['TabularIterator', 'TabularRetriever', 'Normalization', 'Discretization', 'Encoding', 'Visitor', 'Component']
4
5
6
class TabularRetriever(ABC):
7
    @abstractmethod
8
    def column(self, identifier, data):
9
        raise NotImplementedError
10
    @abstractmethod
11
    def row(self, identifier, data):
12
        raise NotImplementedError
13
    @abstractmethod
14
    def nb_columns(self, data):
15
        raise NotImplementedError
16
    @abstractmethod
17
    def nb_rows(self, data):
18
        raise NotImplementedError
19
    @abstractmethod
20
    def get_numerical_attributes(self, data):
21
        raise NotImplementedError
22
23
24
class TabularIterator(ABC):
25
    @abstractmethod
26
    def iterrows(self, data):
27
        raise NotImplementedError
28
    @abstractmethod
29
    def itercolumns(self, data):
30
        raise NotImplementedError
31
    @abstractmethod
32
    def columnnames(self, data):
33
        raise NotImplementedError
34
35
36
class Normalization(metaclass=ABCMeta):
37
38
    @classmethod
39
    def __subclasshook__(cls, subclass):
40
        return hasattr(subclass, 'normalize') and callable(subclass.normalize)
41
42
    @abstractmethod
43
    def normalize(self, *args, **kwargs):
44
        raise NotImplementedError
45
46
47
class Discretization(metaclass=ABCMeta):
48
49
    @classmethod
50
    def __subclasshook__(cls, subclass):
51
        return hasattr(subclass, 'discretize') and callable(subclass.discretize)
52
53
    @abstractmethod
54
    def discretize(self, *args, **kwargs):
55
        raise NotImplementedError
56
57
58
class Encoding(metaclass=ABCMeta):
59
60
    @classmethod
61
    def __subclasshook__(cls, subclass):
62
        return hasattr(subclass, 'encode') and callable(subclass.encode)
63
64
    @abstractmethod
65
    def encode(self, *args, **kwargs):
66
        raise NotImplementedError
67