-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note on use of tpcp.Algorithm classes #13
Comments
Here as well:
|
I tried to address your raised Issue in: fa2b888 & e14b7c2 . |
There are still computations in the respective inits. The parameters of an algorithm can (and will be changed, e.g. in a gridsearch) without rerunning the init. In result dependent computations that only exist in the init become out of sync. If you want to cache expensive computations, use proper caching that tracks inputs. Btw. you also don't need to initilize result variables and others in the init. You can just set the typehints in the class body and then set them when needed. |
I saw that at least in one of the algorithms implemented here (
eargait/eargait/gait_sequence_detection/gait_sequence_detector.py
Line 93 in ffd8336
__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 (usingset_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)
The text was updated successfully, but these errors were encountered: