def normalizeDictSegments(feat_seg, thresholds): '''Return new dict of normalized, segmented features for each test. thresholds provided must be same as ones used for feat normalization prior to cdbk training''' feat_seg_norm = copy.deepcopy(feat_seg) for key, test in feat_seg_norm.iteritems(): for seg in test: seg = scrub.normalizeByColumn(seg, thresholds) return feat_seg_norm
def normalizeListSegments(feat_seg, thresholds): '''Return new list of normalized, segmented features for each test. thresholds provided must be same as ones used for feat normalization prior to cdbk training''' feat_seg_norm = copy.deepcopy(feat_seg) return [scrub.normalizeByColumn(segment, thresholds) for segment in feat_seg_norm]