-
Notifications
You must be signed in to change notification settings - Fork 17
/
base.py
35 lines (27 loc) · 839 Bytes
/
base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from abc import abstractmethod
class _BaseImpute(object):
"""Base class for imputation methods.
Warning: This class should not be used directly.
Use derived classes instead.
"""
@abstractmethod
def fit(self):
""" Placeholder for fit this
should be implemetned by sub-method"""
def transform(self):
""" Apply imputation to X_sparse
"""
return self.sample_weights
class _BaseTransform(object):
"""Base class for transformation/norm methods.
Warning: This class should not be used directly.
Use derived classes instead.
"""
@abstractmethod
def fit(self):
""" Placeholder for fit this
should be implemetned by sub-method"""
def transform(self):
""" Apply imputation to X_sparse
"""
return self.X_sp