-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make settings pickable #845
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #845 +/- ##
=======================================
Coverage ? 95.86%
=======================================
Files ? 18
Lines ? 1861
Branches ? 365
=======================================
Hits ? 1784
Misses ? 38
Partials ? 39
Continue to review full report at Codecov.
|
|
wow, really funky design,
I wonder, are there some limitations on what kind of operations are allowed inside the function body? |
|
As the code is executed on the same machine with the same interpreter (in multiprocessing), that is not a problem. For multi-node setups such as Dask, one needs to think about that anywho, so this PR does not make it worse. |
|
This changes does not work when we run under interactive environment for job > 1, on Windows 10. It will work running inside the main function. |
|
Hi @vutle - oh, this is bad. But it does work for non-custom feature extractors? |
|
Yes, it works for non custom feature extraction if no_job < 2.
Regards
Vu
…On Sun, 13 Jun 2021, 6:31 pm Nils Braun, ***@***.***> wrote:
Hi @vutle <https://github.com/vutle> - oh, this is bad. But it does work
for non-custom feature extractors?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#845 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPT5CAN2PYK5NE4YTW3J3DTSRUHVANCNFSM43DMGFNA>
.
|
|
I found that if you put the custom feature extraction inside a class and you initialised this class before usage, it will work correctly in both interactive and non interactive mode for any number of no_job. Since the function is registered in the memory address. |
|
Can you maybe share the error message you see (when it fails in parallel mode)? |
|
Hi, extract_features with a single job stalls with this example, although there are no problems with MinimalFCParameters. No exceptions are thrown and also the documentation of your website do not work. Env: |
|
Hi @enesok - sorry for the massive delay. The documentation on our website (https://tsfresh.readthedocs.io/en/latest/index.html) works for me. The As a hint: if you comment on already closed PRs, there is a high chance people will miss it (because the topic is already closed). Best is to create a new issue in this case! |
As discussed in #482, there is the need to allow developers to integrate custom feature definitions into tsfresh, without editing the
feature_calculators.pyfile (which e.g. means you need to download and build from source).In principle, that can be done quite easily with (a) additional arguments to
extract_featuresor monkeypatching as shown in #482. The problem however is, that these methods either break on the boundary between processes or machines (because self-defined functions have problems when pickling) or do not work on all OSs.With this PR, I am proposing another solution. As mentioned in the issue,
cloudpickleis able to pickle and unpickle functions correctly. As multiprocessing is not using cloudpickle by default, I had to "cheat" a bit and make the settings dictionaries use cloudpickle by under the hood.With the changes, it is now possible to create custom feature extractors "online" and add them to the settings: