| 53 | |
| 54 | |
| 55 | class SamplingMethod(object): |
| 56 | __metaclass__ = abc.ABCMeta |
| 57 | |
| 58 | @abc.abstractmethod |
| 59 | def __init__(self, X, y, seed, **kwargs): |
| 60 | self.X = X |
| 61 | self.y = y |
| 62 | self.seed = seed |
| 63 | |
| 64 | def flatten_X(self): |
| 65 | shape = self.X.shape |
| 66 | flat_X = self.X |
| 67 | if len(shape) > 2: |
| 68 | flat_X = np.reshape(self.X, (shape[0],np.product(shape[1:]))) |
| 69 | return flat_X |
| 70 | |
| 71 | |
| 72 | @abc.abstractmethod |
| 73 | def select_batch_(self): |
| 74 | return |
| 75 | |
| 76 | def select_batch(self, **kwargs): |
| 77 | return self.select_batch_(**kwargs) |
| 78 | |
| 79 | def select_batch_unc_(self, **kwargs): |
| 80 | return self.select_batch_unc_(**kwargs) |
| 81 | |
| 82 | def to_dict(self): |
| 83 | return None |
| 84 | |
| 85 | |
| 86 |
nothing calls this directly
no outgoing calls
no test coverage detected