-
Notifications
You must be signed in to change notification settings - Fork 2
/
manager.py
65 lines (47 loc) · 1.42 KB
/
manager.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# (c) 2016 JUIGIL KISHORE ALL RIGHTS RESERVED
import numpy
import labels
from features import WaveletFeatures
from constants import WAVELET_DECOMPOSITION_LEVEL
class ECGBeat(object):
"""
ECGBeat Class to hold the single ecg beat's data and ailment
"""
def __init__(self, samples, ailment):
self.samples = numpy.matrix(samples)
self.ailment = ailment
self.num = len(samples)
class ECGBeatFeatures(object):
"""
Class to extract and select features from the ecg beat
"""
def __init__(self, samples, ailment):
self.samples = samples
self.ailment = ailment
class Classifier(object):
"""
Manager class that passes the ECG samples through the trained algorithm
"""
def __init__(self, samples):
self.samples = numpy.matrix(samples)
self.LABEL = labels.UNTRAINED
self.pattern = WaveletFeatures(self.samples,
WAVELET_DECOMPOSITION_LEVEL)
self._routine()
def _routine(self):
self._feature_extraction()
self._feature_selection()
def _feature_extraction(self):
pass
def _feature_selection(self):
pass
class CombinedNeuralNet(object):
"""
Implements the combined neural network algorithm
"""
def __init__(self, data, label):
self.experiments = (data, label)
def train(self):
pass
def test(self):
pass