def main( dataset_name="anguita2013", fs_new=33, win_len=2.56, win_inc=1.0, task="har", split_type="predefined", feat_name="all", ): dataset = dataset_importer(dataset_name) resampled = transformers.resample(parent=dataset, fs_new=fs_new) filtered = transformers.body_grav_filter(parent=resampled) windowed = transformers.window(parent=filtered, win_len=win_len, win_inc=win_inc) accel_feats = features.ecdf(parent=windowed, source_filter=take_all(), source_name=feat_name, n_components=21) task = selectors.select_task(parent=accel_feats, task_name=task) split = selectors.select_split(parent=task, split_type=split_type) clf = models.sgd_classifier(parent=split, split=split, task=task, data=accel_feats) clf.evaluate_outputs() return clf
def dataset_windowed(name, fs_new=33, win_len=2.56, win_inc=1.0): dataset = dataset_importer(name) resampled = transformers.resample(parent=dataset, fs_new=fs_new) filtered = transformers.body_grav_filter(parent=resampled) windowed = transformers.window(parent=filtered, win_len=win_len, win_inc=win_inc) return windowed
def main( dataset_name, source_filter, feat_name, clf_name, fs_new, win_len, win_inc, split_type, ): dataset = dataset_importer(dataset_name) resampled = transformers.resample( parent=dataset, fs_new=fs_new ) filtered = transformers.body_grav_filter( parent=resampled ) windowed = transformers.window( parent=filtered, win_len=win_len, win_inc=win_inc ) if feat_name == 'ecdf': feats = features.ecdf( parent=windowed, source_filter=source_filter, n_components=21 ) elif feat_name == 'statistical': feats = features.statistical_features( parent=windowed, source_filter=source_filter, ) else: raise ValueError task = selectors.select_task( parent=feats, task_name='har' ) split = selectors.select_split( parent=task, split_type=split_type ) if clf_name == 'sgd_classifier': clf = models.sgd_classifier( parent=split, data=feats ) elif clf_name == 'logistic_regression_cv': clf = models.logistic_regression_cv( parent=split, data=feats ) else: raise ValueError return clf.get_results()