mad-lab-fau / eargait

EarGait - The Gait Analysis Package for Ear-Worn IMU Sensors !
MIT License
6 stars 0 forks source link

Note on use of tpcp.Algorithm classes #13

Open AKuederle opened 1 month ago

AKuederle commented 1 month ago

I saw that at least in one of the algorithms implemented here (https://github.com/mad-lab-fau/eargait/blob/ffd83365ae3cd4351c53ff7b93d92da9a33ffb7e/eargait/gait_sequence_detection/gait_sequence_detector.py#L93), have a bunch of loading in the __init__. This is discuraged in the context of tpcp/sklearn and similar frameworks, as the idea is that parameters can be modified even after the init (using set_params) and the assumption is that creating an instance is "cheap" and it is hence done under the hood often (e.g. via .clone).

All logic should be put where it is first needed (aka in detect or train method)

AKuederle commented 1 month ago

Here as well: https://github.com/mad-lab-fau/eargait/blob/ffd83365ae3cd4351c53ff7b93d92da9a33ffb7e/eargait/event_detection/mixed_event_detection.py#L78