Tweak of joblib.Parallel
that propagates the scikit-learn configuration.
This subclass of joblib.Parallel
ensures that the active configuration (thread-local) of scikit-learn is propagated to the parallel workers for the duration of the execution of the parallel tasks.
The API does not change and you can refer to joblib.Parallel
documentation for more details.
new Parallel(opts?: object): Parallel;
Name | Type |
---|---|
opts? |
object |
Defined in: generated/utils/parallel/Parallel.ts:25
Dispatch more data for parallel processing
This method is meant to be called concurrently by the multiprocessing callback. We rely on the thread-safety of dispatch_one_batch to protect against concurrent consumption of the unprotected iterator.
dispatch_next(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/parallel/Parallel.ts:99
Prefetch the tasks for the next batch and dispatch them.
The effective size of the batch is computed here. If there are no more jobs to dispatch, return false
, else return true
.
The iterator consumption and dispatching is protected by the same lock so calling this function should be thread safe.
dispatch_one_batch(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/parallel/Parallel.ts:129
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/utils/parallel/Parallel.ts:80
Return the formatted representation of the object.
format(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/parallel/Parallel.ts:155
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/utils/parallel/Parallel.ts:43
Display the process of the parallel execution only a fraction of time, controlled by self.verbose.
print_progress(opts: object): Promise<any>;
Name | Type |
---|---|
opts |
object |
Promise
<any
>
Defined in: generated/utils/parallel/Parallel.ts:181
boolean
=false
Defined in: generated/utils/parallel/Parallel.ts:23
boolean
=false
Defined in: generated/utils/parallel/Parallel.ts:22
PythonBridge
Defined in: generated/utils/parallel/Parallel.ts:21
string
Defined in: generated/utils/parallel/Parallel.ts:18
any
Defined in: generated/utils/parallel/Parallel.ts:19
py(): PythonBridge;
PythonBridge
Defined in: generated/utils/parallel/Parallel.ts:30
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/utils/parallel/Parallel.ts:34