mitre/menelaus

Column selectors

Anmol-Srivastava opened this issue · 0 comments

Task

For ensembles, column selection should ultimately be function-based. So:

fn = lambda x: x[['col1', 'col2']]

or

def fn(x):
    return x[:, 0:2]

can all be passed into the ensemble and used in ensemble.select_data().

Impact

This will create just one easy entrypoint, i.e. different parts of the same input can be used, for different detectors in one ensemble. Selector functions can ensure that ensemble-side code doesn't break upon filtering the input, and avoids type-checking based on pandas or numpy input.

Details

A defaultdict can ensure that when the set of selectors given to an ensemble doesn't have an entry for one detector, things have default behavior. See #101 (comment)