diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2012-02-24 23:58:13 -0800 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2012-02-24 23:58:13 -0800 |
| commit | 97528739b7f89b7264b016fe489318d143428b71 (patch) | |
| tree | b0538150ed56a5c8386e3c654ac724720f27c343 /data | |
| parent | 12638168c8d9db452b9db3387cf7400c714e6c47 (diff) | |
| download | kinect-97528739b7f89b7264b016fe489318d143428b71.tar.gz | |
Remove useless masked array from svm classification
Diffstat (limited to 'data')
| -rwxr-xr-x | data/svm/classification.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/data/svm/classification.py b/data/svm/classification.py index 08e5363..b8c0ae6 100755 --- a/data/svm/classification.py +++ b/data/svm/classification.py @@ -10,10 +10,7 @@ import random def normalize(a,weights=None): if weights == None: - weights= {} - cols = a.shape[1] - for i in range(cols): - weights[i] = None + weights= {i:None for i in range(a.shape[1])} for i in weights.keys(): column = a[:,i] @@ -36,12 +33,11 @@ def read_filter(filename) : return a def normalize_filter(a,weights=None,nameset=None): - a = np.ma.masked_array(a) #normalize data if weights==None: weights = {i:None for i in range(4,13)} a,weights = normalize(a,weights) - + if nameset != None: indexes = [i for i in range(a.shape[0]) if a[i,0] in nameset] a = a[indexes] |
