if not isinstance(f, self.method.feature_type)]
scores = [self.method(f, data) for f in features]
top_ind = self.select_best(scores)
domain = Orange.data.Domain([features[i] for i in top_ind] + other,
data.domain.class_vars, data.domain.metas)
return data.from_table(domain, data)
After Change
other = [f for f in data.domain.attributes
if not isinstance(f, self.method.feature_type)]
scores = [self.method(f, data) for f in features]
best = sorted(zip(scores, features), key=itemgetter(0),
reverse=self.decreasing)
if self.k:
best = best[:self.k]
if self.threshold:
pred = ((lambda x: x[0] >= self.threshold) if self.decreasing else
(lambda x: x[0] <= self.threshold))
best = takewhile(pred, best)
domain = Orange.data.Domain([f for s, f in best] + other,
data.domain.class_vars, data.domain.metas)
return data.from_table(domain, data)