Skip to content

[Feature request] Implement n_jobs=-2 like scikit-learn #817

@mendel5

Description

@mendel5

When working with sklearn (scikit-learn) I am used to setting the parameter n_jobs=-2. As explained at https://scikit-learn.org/stable/glossary.html#term-n_jobs this means:

n_jobs is an integer, specifying the maximum number of concurrently running workers.
If 1 is given, no joblib parallelism is used at all, which is useful for debugging.
If set to -1, all CPUs are used. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used.
For example with n_jobs=-2, all CPUs but one are used.

When I set the parameter n_jobs=-2 in the extract_features() function I get an error: ValueError: Number of processes must be at least 1.

If tsfresh would be able to accept the parameter n_jobs=-2 it would be possible to write code for different kinds of CPUs and tell tsfresh "use all CPU cores except for one core". Therefore the code adapts to the CPU it's running on which might be an older Intel 4-core CPU or a newer Ryzen 8, 12 or 16-core CPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions