pybear-dask 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pybear_dask/__init__.py +19 -0
- pybear_dask/_version.py +38 -0
- pybear_dask/base/__init__.py +24 -0
- pybear_dask/base/_is_classifier.py +186 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/GSTCVDask.py +918 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/__init__.py +5 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/__init__.py +5 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_estimator_fit_params_helper.py +106 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_fold_splitter.py +86 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_get_kfold.py +117 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_parallelized_fit.py +127 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_parallelized_scorer.py +228 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_parallelized_train_scorer.py +226 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_param_conditioning/__init__.py +5 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_param_conditioning/_scheduler.py +88 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_type_aliases.py +43 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/__init__.py +5 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_cache_cv.py +37 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_dask_estimator.py +84 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_iid.py +38 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_validation.py +54 -0
- pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_y.py +91 -0
- pybear_dask/model_selection/GSTCV/__init__.py +5 -0
- pybear_dask/model_selection/__init__.py +28 -0
- pybear_dask/model_selection/autogridsearch/AutoGSTCVDask.py +71 -0
- pybear_dask/model_selection/autogridsearch/AutoGridSearchCVDask.py +70 -0
- pybear_dask/model_selection/autogridsearch/__init__.py +19 -0
- pybear_dask/model_selection/autogridsearch/_autogridsearch_wrapper/__init__.py +5 -0
- pybear_dask/model_selection/autogridsearch/_autogridsearch_wrapper/_refit_can_be_skipped.py +100 -0
- pybear_dask-0.2.0.dist-info/LICENSE +28 -0
- pybear_dask-0.2.0.dist-info/METADATA +253 -0
- pybear_dask-0.2.0.dist-info/RECORD +33 -0
- pybear_dask-0.2.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Author:
|
|
2
|
+
# Bill Sousa
|
|
3
|
+
#
|
|
4
|
+
# License: BSD 3 clause
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from .autogridsearch.AutoGridSearchCVDask import AutoGridSearchCVDask
|
|
10
|
+
from .GSTCV._GSTCVDask.GSTCVDask import GSTCVDask
|
|
11
|
+
from .autogridsearch.AutoGSTCVDask import AutoGSTCVDask
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
'GSTCVDask',
|
|
17
|
+
'AutoGridSearchCVDask',
|
|
18
|
+
'AutoGSTCVDask'
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Author:
|
|
2
|
+
# Bill Sousa
|
|
3
|
+
#
|
|
4
|
+
# License: BSD 3 clause
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from typing import (
|
|
10
|
+
Optional,
|
|
11
|
+
Sequence,
|
|
12
|
+
Tuple
|
|
13
|
+
)
|
|
14
|
+
from typing_extensions import (
|
|
15
|
+
Any,
|
|
16
|
+
Union
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
import numbers
|
|
20
|
+
|
|
21
|
+
from pybear.model_selection.autogridsearch.autogridsearch_wrapper import autogridsearch_wrapper
|
|
22
|
+
from pybear.model_selection.autogridsearch import autogridsearch_docs
|
|
23
|
+
|
|
24
|
+
from ..GSTCV._GSTCVDask.GSTCVDask import GSTCVDask
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AutoGSTCVDask(autogridsearch_wrapper(GSTCVDask)):
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
__doc__ = autogridsearch_docs.__doc__
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
estimator,
|
|
37
|
+
params: dict[
|
|
38
|
+
str,
|
|
39
|
+
Sequence[Tuple[
|
|
40
|
+
Sequence[Any],
|
|
41
|
+
Union[numbers.Integral, Sequence[numbers.Integral]],
|
|
42
|
+
str
|
|
43
|
+
]]
|
|
44
|
+
],
|
|
45
|
+
*,
|
|
46
|
+
total_passes:Optional[numbers.Integral] = 5,
|
|
47
|
+
total_passes_is_hard:Optional[bool] = False,
|
|
48
|
+
max_shifts:Optional[Union[None, numbers.Integral]] = None,
|
|
49
|
+
agscv_verbose:Optional[bool] = False,
|
|
50
|
+
**parent_gscv_kwargs
|
|
51
|
+
):
|
|
52
|
+
|
|
53
|
+
"""Initialize the `AutoGSTCVDask` instance."""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
super().__init__(
|
|
57
|
+
estimator,
|
|
58
|
+
params,
|
|
59
|
+
total_passes=total_passes,
|
|
60
|
+
total_passes_is_hard=total_passes_is_hard,
|
|
61
|
+
max_shifts=max_shifts,
|
|
62
|
+
agscv_verbose=agscv_verbose,
|
|
63
|
+
**parent_gscv_kwargs
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Author:
|
|
2
|
+
# Bill Sousa
|
|
3
|
+
#
|
|
4
|
+
# License: BSD 3 clause
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from typing import (
|
|
10
|
+
Optional,
|
|
11
|
+
Sequence,
|
|
12
|
+
Tuple
|
|
13
|
+
)
|
|
14
|
+
from typing_extensions import (
|
|
15
|
+
Any,
|
|
16
|
+
Union
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
import numbers
|
|
20
|
+
|
|
21
|
+
from pybear.model_selection import autogridsearch_wrapper
|
|
22
|
+
from pybear.model_selection.autogridsearch import autogridsearch_docs
|
|
23
|
+
|
|
24
|
+
from dask_ml.model_selection import GridSearchCV as dask_GridSearchCV
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AutoGridSearchCVDask(autogridsearch_wrapper(dask_GridSearchCV)):
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
__doc__ = autogridsearch_docs.__doc__
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
estimator,
|
|
37
|
+
params: dict[
|
|
38
|
+
str,
|
|
39
|
+
Sequence[Tuple[
|
|
40
|
+
Sequence[Any],
|
|
41
|
+
Union[numbers.Integral, Sequence[numbers.Integral]],
|
|
42
|
+
str
|
|
43
|
+
]]
|
|
44
|
+
],
|
|
45
|
+
*,
|
|
46
|
+
total_passes:Optional[numbers.Integral] = 5,
|
|
47
|
+
total_passes_is_hard:Optional[bool] = False,
|
|
48
|
+
max_shifts:Optional[Union[None, numbers.Integral]] = None,
|
|
49
|
+
agscv_verbose:Optional[bool] = False,
|
|
50
|
+
**parent_gscv_kwargs
|
|
51
|
+
):
|
|
52
|
+
|
|
53
|
+
"""Initialize the `AutoGridSearchCVDask` instance."""
|
|
54
|
+
|
|
55
|
+
super().__init__(
|
|
56
|
+
estimator,
|
|
57
|
+
params,
|
|
58
|
+
total_passes=total_passes,
|
|
59
|
+
total_passes_is_hard=total_passes_is_hard,
|
|
60
|
+
max_shifts=max_shifts,
|
|
61
|
+
agscv_verbose=agscv_verbose,
|
|
62
|
+
**parent_gscv_kwargs
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Author:
|
|
2
|
+
# Bill Sousa
|
|
3
|
+
#
|
|
4
|
+
# License: BSD 3 clause
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from typing import (
|
|
10
|
+
Callable,
|
|
11
|
+
Literal
|
|
12
|
+
)
|
|
13
|
+
from typing_extensions import Union
|
|
14
|
+
|
|
15
|
+
from ...GSTCV._GSTCVDask import GSTCVDask
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _refit_can_be_skipped(
|
|
20
|
+
_GridSearchParent,
|
|
21
|
+
_scoring: Union[None, str, list, Callable, dict, Literal[False]],
|
|
22
|
+
_total_passes: int
|
|
23
|
+
) -> bool:
|
|
24
|
+
"""Determine if the parent GridSearch, the scoring strategy, and the
|
|
25
|
+
total number of passes allow for refits to be skipped until the
|
|
26
|
+
final pass.
|
|
27
|
+
|
|
28
|
+
`best_params_` needs to be exposed on every pass. Some GridSearch
|
|
29
|
+
parents require that `refit` be True to expose `best_params_`. All
|
|
30
|
+
require that `refit` be specified if `scoring` is multiple scorers
|
|
31
|
+
to expose `best_params_`. Refit cannot be skipped if agscv is only
|
|
32
|
+
running one pass.
|
|
33
|
+
|
|
34
|
+
This ignores whether `refit` was originally passed as False. If it
|
|
35
|
+
was, then this module will still allow agscv to overwrite pre-final
|
|
36
|
+
pass `refit` with False, which is just overwriting the same value.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
_GridSearchParent : GridSearchCV instance
|
|
41
|
+
The parent GridSearchCV class passed to the agscv wrapper.
|
|
42
|
+
_scoring : Union[None, str, list, Callable, dict, Literal[False]]
|
|
43
|
+
The value passed to the `scoring` parameter of the parent
|
|
44
|
+
GridSearchCV. On the off chance that the parent GridSearch does
|
|
45
|
+
not have a `scoring` parameter, Literal[False] is passed to here.
|
|
46
|
+
_total_passes : int
|
|
47
|
+
The number of grid searches to perform. This number is dynamic
|
|
48
|
+
and can be incremented by agscv during a run, based on the need
|
|
49
|
+
to shift grids and the setting of `total_passes_is_hard`.
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
_refit_can_be_skipped : bool
|
|
54
|
+
Whether or not to allow refits to be skipped until the last pass
|
|
55
|
+
of agscv.
|
|
56
|
+
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# *** ONLY REFIT ON THE LAST PASS TO SAVE TIME WHEN POSSIBLE ***
|
|
61
|
+
# IS POSSIBLE WHEN PARENT:
|
|
62
|
+
# == has refit param, is not False, AND is using only one scorer
|
|
63
|
+
# IS NOT POSSIBLE WHEN:
|
|
64
|
+
# == total_passes = 1
|
|
65
|
+
# == When using multiple scorers, refit must always be left on
|
|
66
|
+
# because multiple scorers dont expose best_params_ when
|
|
67
|
+
# multiscorer and refit=False
|
|
68
|
+
# == using dask GridSearchCV or dask RandomizedSearchCV, they
|
|
69
|
+
# require refit always be True to expose best_params_.
|
|
70
|
+
# == dask IncrementalSearchCV, HyperbandSearchCV,
|
|
71
|
+
# SuccessiveHalvingSearchCV and InverseDecaySearchCV do not take a
|
|
72
|
+
# refit kwarg.
|
|
73
|
+
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
|
74
|
+
# dask_ml is the fly in the ointment. Always leave refit as the user
|
|
75
|
+
# passed it. So apply the rules for managing refits to GSTCVDask only.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# all of these have refit
|
|
79
|
+
_is_candidate_gscv = _GridSearchParent in (GSTCVDask, )
|
|
80
|
+
|
|
81
|
+
# if 'scoring' is not available from parent (Literal[False] was sent
|
|
82
|
+
# into here), assume the worst case and set _is_multimetric to True
|
|
83
|
+
# so that refit (if available) will always run
|
|
84
|
+
_is_multimetric = 1
|
|
85
|
+
_is_multimetric -= callable(_scoring)
|
|
86
|
+
_is_multimetric -= isinstance(_scoring, (str, type(None)))
|
|
87
|
+
# sklearn anomaly that list scoring is always multimetric,
|
|
88
|
+
# even if len(list)==1.
|
|
89
|
+
_is_not_multimetric = not bool(_is_multimetric)
|
|
90
|
+
|
|
91
|
+
_is_multipass = (_total_passes > 1)
|
|
92
|
+
# *** END ONLY REFIT ON THE LAST PASS TO SAVE TIME ************
|
|
93
|
+
# *************************************************************
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
return (_is_candidate_gscv and _is_not_multimetric and _is_multipass)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, PylarBear
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: pybear-dask
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Python modules for data analytics applications with dask
|
|
5
|
+
License: BSD-3-Clause
|
|
6
|
+
Keywords: python data analytics pybear dask
|
|
7
|
+
Author: Bill Sousa
|
|
8
|
+
Author-email: WKSJR99@msn.com
|
|
9
|
+
Maintainer: Bill Sousa
|
|
10
|
+
Requires-Python: >=3.10,<3.13
|
|
11
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Dist: dask (<2025.1)
|
|
17
|
+
Requires-Dist: dask-ml (<2025.1)
|
|
18
|
+
Requires-Dist: distributed (<2025.1)
|
|
19
|
+
Requires-Dist: polars-lts-cpu (>=1.31.0,<2.0.0)
|
|
20
|
+
Requires-Dist: pybear (>=0.2.0)
|
|
21
|
+
Requires-Dist: scikit-learn (<1.7)
|
|
22
|
+
Project-URL: Homepage, https://github.com/PylarBear/pybear-dask
|
|
23
|
+
Project-URL: Repository, https://github.com/PylarBear/pybear-dask
|
|
24
|
+
Description-Content-Type: text/x-rst
|
|
25
|
+
|
|
26
|
+
pybear-dask
|
|
27
|
+
===========
|
|
28
|
+
|
|
29
|
+
|Tests|
|
|
30
|
+
|Coverage|
|
|
31
|
+
|Test Status 313|
|
|
32
|
+
|Test Status 312|
|
|
33
|
+
|Test Status 311|
|
|
34
|
+
|Test Status 310|
|
|
35
|
+
|
|
36
|
+
.. |Tests| image:: https://raw.githubusercontent.com/PylarBear/pybear-dask/main/.github/badges/tests-badge.svg
|
|
37
|
+
:target: https://github.com/PylarBear/pybear-dask/actions
|
|
38
|
+
|
|
39
|
+
.. |Coverage| image:: https://raw.githubusercontent.com/PylarBear/pybear-dask/main/.github/badges/coverage-badge.svg
|
|
40
|
+
:target: https://github.com/PylarBear/pybear-dask/actions
|
|
41
|
+
|
|
42
|
+
.. |Test Status 313| image:: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py313.yml/badge.svg
|
|
43
|
+
:target: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py313.yml
|
|
44
|
+
|
|
45
|
+
.. |Test Status 312| image:: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py312.yml/badge.svg
|
|
46
|
+
:target: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py312.yml
|
|
47
|
+
|
|
48
|
+
.. |Test Status 311| image:: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py311.yml/badge.svg
|
|
49
|
+
:target: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py311.yml
|
|
50
|
+
|
|
51
|
+
.. |Test Status 310| image:: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py310.yml/badge.svg
|
|
52
|
+
:target: https://github.com/PylarBear/pybear-dask/actions/workflows/matrix-tests-py310.yml
|
|
53
|
+
|
|
54
|
+
|TestPyPI Build Status|
|
|
55
|
+
|
|
56
|
+
.. |TestPyPI Build Status| image:: https://github.com/PylarBear/pybear-dask/actions/workflows/testpypi-publish.yml/badge.svg
|
|
57
|
+
:target: https://github.com/PylarBear/pybear-dask/actions/workflows/testpypi-publish.yml
|
|
58
|
+
|
|
59
|
+
|PyPI Build Status|
|
|
60
|
+
|Version|
|
|
61
|
+
|PyPI Downloads|
|
|
62
|
+
|
|
63
|
+
.. |PyPI Build Status| image:: https://github.com/PylarBear/pybear-dask/actions/workflows/pypi-publish.yml/badge.svg
|
|
64
|
+
:target: https://github.com/PylarBear/pybear-dask/actions/workflows/pypi-publish.yml
|
|
65
|
+
|
|
66
|
+
.. |Version| image:: https://img.shields.io/pypi/v/pybear-dask
|
|
67
|
+
:target: https://pypi.org/project/pybear-dask
|
|
68
|
+
:alt: PyPI Version
|
|
69
|
+
|
|
70
|
+
.. |PyPI Downloads| image:: https://static.pepy.tech/badge/pybear-dask
|
|
71
|
+
:target: https://pepy.tech/project/pybear-dask/
|
|
72
|
+
:alt: PyPI Downloads
|
|
73
|
+
|
|
74
|
+
.. |PythonVersion| replace:: >=3.10, <3.13
|
|
75
|
+
.. |DaskVersion| replace:: <2025.1.0
|
|
76
|
+
.. |DaskMLVersion| replace:: <2025.1.0
|
|
77
|
+
.. |DistributedVersion| replace:: <2025.1.0
|
|
78
|
+
.. |PybearVersion| replace:: >=0.1.22
|
|
79
|
+
.. |PytestVersion| replace:: >=7.0.0
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
pybear-dask is a Python computing library that supplements the pybear
|
|
84
|
+
library with analogous modules that have dask capability.
|
|
85
|
+
|
|
86
|
+
Website: https://github.com/PylarBear/pybear-dask
|
|
87
|
+
|
|
88
|
+
License
|
|
89
|
+
-------
|
|
90
|
+
|
|
91
|
+
BSD 3-Clause License. See `License File <https://github.com/PylarBear/pybear-dask/blob/main/LICENSE>`__.
|
|
92
|
+
|
|
93
|
+
=======
|
|
94
|
+
|
|
95
|
+
Installation
|
|
96
|
+
------------
|
|
97
|
+
|
|
98
|
+
Dependencies
|
|
99
|
+
~~~~~~~~~~~~
|
|
100
|
+
|
|
101
|
+
pybear-dask requires:
|
|
102
|
+
|
|
103
|
+
- Python (|PythonVersion|)
|
|
104
|
+
- dask (|DaskVersion|)
|
|
105
|
+
- dask-ml (|DaskMLVersion|)
|
|
106
|
+
- distributed (|DistributedVersion|)
|
|
107
|
+
- pybear (|PybearVersion|)
|
|
108
|
+
|
|
109
|
+
User installation
|
|
110
|
+
~~~~~~~~~~~~~~~~~
|
|
111
|
+
|
|
112
|
+
Install pybear-dask from the online PyPI package repository using ``pip``::
|
|
113
|
+
|
|
114
|
+
(your-env) $ pip install pybear-dask
|
|
115
|
+
|
|
116
|
+
Conda distributions are expected to be made available sometime after release to
|
|
117
|
+
PyPI.
|
|
118
|
+
|
|
119
|
+
=======
|
|
120
|
+
|
|
121
|
+
Usage
|
|
122
|
+
-----
|
|
123
|
+
The folder structure of pybear-dask is nearly identical to scikit-learn. This
|
|
124
|
+
is so those that are familiar with the scikit layout and have experience with
|
|
125
|
+
writing the associated import statements have an easy transition to pybear-dask.
|
|
126
|
+
The pybear-dask subfolders are *base* and *model_selection*.
|
|
127
|
+
|
|
128
|
+
You can import pybear-dask's packages in the same way you would with scikit.
|
|
129
|
+
Here are a few examples of how you could import and use pybear-dask modules:
|
|
130
|
+
|
|
131
|
+
.. code-block:: console
|
|
132
|
+
|
|
133
|
+
from pybear-dask.model_selection import GSTCVDask
|
|
134
|
+
|
|
135
|
+
search = GSTCVDask()
|
|
136
|
+
search.fit(X, y)
|
|
137
|
+
|
|
138
|
+
from pybear-dask import model_selection as ms
|
|
139
|
+
|
|
140
|
+
search = ms.AutoGridSearchCVDask()
|
|
141
|
+
search.fit(X, y)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
=======
|
|
145
|
+
|
|
146
|
+
Major Modules
|
|
147
|
+
-------------
|
|
148
|
+
|
|
149
|
+
AutoGridSearchCVDask
|
|
150
|
+
~~~~~~~~~~~~~~~~~~~~
|
|
151
|
+
Perform multiple uninterrupted passes of grid search with dask_ml GridSearchCV
|
|
152
|
+
and dask objects utilizing progressively narrower search grids.
|
|
153
|
+
|
|
154
|
+
- Access via pybear-dask.model_selection.AutoGridSearchCVDask.
|
|
155
|
+
|
|
156
|
+
GSTCVDask (GridSearchThresholdCV for Dask)
|
|
157
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
158
|
+
Perform conventional grid search on a classifier with concurrent threshold
|
|
159
|
+
search using dask objects in parallel and distributed environments. Finds the
|
|
160
|
+
global optima for the passed parameters and thresholds. Fully compliant with
|
|
161
|
+
the dask_ml/scikit-learn GridSearchCV API.
|
|
162
|
+
|
|
163
|
+
- Access via pybear-dask.model_selection.GSTCVDask.
|
|
164
|
+
|
|
165
|
+
AutoGSTCVDask (AutoGridSearchThresholdCV for Dask)
|
|
166
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
167
|
+
Perform multiple uninterrupted passes of grid search with pybear-dask GSTCVDask
|
|
168
|
+
utilizing progressively narrower search grids.
|
|
169
|
+
|
|
170
|
+
- Access via pybear-dask.model_selection.AutoGSTCVDask.
|
|
171
|
+
|
|
172
|
+
=======
|
|
173
|
+
|
|
174
|
+
Changelog
|
|
175
|
+
---------
|
|
176
|
+
|
|
177
|
+
See the `changelog <https://github.com/PylarBear/pybear-dask/blob/main/CHANGELOG.md>`__
|
|
178
|
+
for a history of notable changes to pybear-dask.
|
|
179
|
+
|
|
180
|
+
=======
|
|
181
|
+
|
|
182
|
+
Development
|
|
183
|
+
-----------
|
|
184
|
+
|
|
185
|
+
Important links
|
|
186
|
+
~~~~~~~~~~~~~~~
|
|
187
|
+
|
|
188
|
+
- Official source code repo: https://github.com/PylarBear/pybear-dask
|
|
189
|
+
- Download releases: https://pypi.org/project/pybear-dask/
|
|
190
|
+
- Issue tracker: https://github.com/PylarBear/pybear-dask/issues
|
|
191
|
+
|
|
192
|
+
Source code
|
|
193
|
+
~~~~~~~~~~~
|
|
194
|
+
|
|
195
|
+
You can clone the latest source code with the command::
|
|
196
|
+
|
|
197
|
+
git clone https://github.com/PylarBear/pybear-dask.git
|
|
198
|
+
|
|
199
|
+
Contributing
|
|
200
|
+
~~~~~~~~~~~~
|
|
201
|
+
|
|
202
|
+
pybear-dask is not ready for contributions at this time!
|
|
203
|
+
|
|
204
|
+
Testing
|
|
205
|
+
~~~~~~~
|
|
206
|
+
|
|
207
|
+
pybear-dask 0.2 is tested via GitHub Actions to run on Linux, Windows, and MacOS,
|
|
208
|
+
with Python versions 3.10, 3.11, and 3.12. pybear-dask is not tested on earlier
|
|
209
|
+
versions, but some features may work.
|
|
210
|
+
|
|
211
|
+
If you want to test pybear-dask yourself, you will need:
|
|
212
|
+
|
|
213
|
+
- pytest (|PytestVersion|)
|
|
214
|
+
|
|
215
|
+
The tests are not available in the PyPI pip installation. You can get
|
|
216
|
+
the tests by downloading the tarball from the pybear-dask project page on
|
|
217
|
+
`pypi.org <https://pypi.org/project/pybear-dask/>`_ or cloning the pybear-dask
|
|
218
|
+
repo from `GitHub <https://github.com/PylarBear/pybear-dask>`_. Once you have
|
|
219
|
+
the source files in a local project folder, create a poetry environment for the
|
|
220
|
+
project and install the test dependencies. After installation, launch the poetry
|
|
221
|
+
environment shell and you can launch the test suite from the root of your
|
|
222
|
+
pybear-dask project folder with::
|
|
223
|
+
|
|
224
|
+
(your-pybear-dask-env) you@your_computer:/path/to/pybear-dask/project$ pytest tests/
|
|
225
|
+
|
|
226
|
+
Project History
|
|
227
|
+
---------------
|
|
228
|
+
|
|
229
|
+
This project was spun off the main pybear project just prior to the first
|
|
230
|
+
public release of both. pybear-dask was spun off to ensure maximum stability
|
|
231
|
+
for the main pybear project, while keeping these modules available.
|
|
232
|
+
|
|
233
|
+
Help and Support
|
|
234
|
+
----------------
|
|
235
|
+
|
|
236
|
+
Documentation
|
|
237
|
+
~~~~~~~~~~~~~
|
|
238
|
+
|
|
239
|
+
Documentation is not expected to be made available via a website for this
|
|
240
|
+
package. Use the documentation for similar packages in the main pybear package.
|
|
241
|
+
See the repo for pybear: https://github.com/PylarBear/pybear/
|
|
242
|
+
|
|
243
|
+
Communication
|
|
244
|
+
~~~~~~~~~~~~~
|
|
245
|
+
|
|
246
|
+
- GitHub Discussions: https://github.com/PylarBear/pybear-dask/discussions
|
|
247
|
+
- Website: https://github.com/PylarBear/pybear-dask
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
pybear_dask/__init__.py,sha256=vUdSkmcdItAKeURzahyoxAl_g04TugjGxWlNZUXicmo,196
|
|
2
|
+
pybear_dask/_version.py,sha256=yyF-bRduRXflyU1RM3IFCx7HYUGLPfo0tn3Z-dj_jyQ,816
|
|
3
|
+
pybear_dask/base/__init__.py,sha256=SejIgJhGgxg9k7O6LI6GLXw9EjVC7NfCQhQutvTWZFQ,151
|
|
4
|
+
pybear_dask/base/_is_classifier.py,sha256=Rw5vkC932X7OAjIkeAov0NkWtJsfgquzKrzIOJGlLnI,4919
|
|
5
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/GSTCVDask.py,sha256=DkNkXe_Aq5eM3dKIwE9AZbAaRIog5Vc7kOnFg63tu7M,36556
|
|
6
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/__init__.py,sha256=K41yCp0pkyirNxEueYIA-O6U4LLrnCub2oX4OluAxX8,59
|
|
7
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/__init__.py,sha256=K41yCp0pkyirNxEueYIA-O6U4LLrnCub2oX4OluAxX8,59
|
|
8
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_estimator_fit_params_helper.py,sha256=IfHAyvIRzYX2dwAhehkqg2FB0VJez3kJE-f9E_Fru-E,3504
|
|
9
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_fold_splitter.py,sha256=FyD42Yc5jKkkISMglezo-UHW7uZGC_bD9tLNyDJrUu0,2541
|
|
10
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_get_kfold.py,sha256=-Ns8v0j5JhDzewvuV69SkGJ_VEBbdQNSTqOV0at2YLA,3431
|
|
11
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_parallelized_fit.py,sha256=v4b_5gbOkSnn3Xr_FE3GZxFVagzPSgjByw-jIdhTuc0,3742
|
|
12
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_parallelized_scorer.py,sha256=GxmTqMgfp1jq527MQf3nGB8BmeNuFV_ET_0UyUK-9kY,8177
|
|
13
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_fit/_parallelized_train_scorer.py,sha256=8J1wIICUj04Qz77zHEE9uzNQouq2Jrb7nXQoJdJSJXY,6507
|
|
14
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_param_conditioning/__init__.py,sha256=K41yCp0pkyirNxEueYIA-O6U4LLrnCub2oX4OluAxX8,59
|
|
15
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_param_conditioning/_scheduler.py,sha256=UCkxJYZQc3QZxKrPLYvf9cJU4MxDbViGV_bDRt3Jxwo,2710
|
|
16
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_type_aliases.py,sha256=mv4zUPUsKF6UoRfN7Fb-VpmJ_0fz8HB2WeQGfGifZU4,657
|
|
17
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/__init__.py,sha256=K41yCp0pkyirNxEueYIA-O6U4LLrnCub2oX4OluAxX8,59
|
|
18
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_cache_cv.py,sha256=j0StDWriQKiyMH7t2CuoTEo0cikXJInVMt_r-HYJv0s,567
|
|
19
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_dask_estimator.py,sha256=3JFwSQCCxz66mONVg96w0J4V2FIT4KPsCo2JQd3B09U,2221
|
|
20
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_iid.py,sha256=SJaHKJgVfIuOvafPBgurcvlt8llxAXFnX5DMoewSBow,521
|
|
21
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_validation.py,sha256=rbYcTO1inWRB-qH6t9zTVnnum8xSBhKY420BJW3Q5YM,1232
|
|
22
|
+
pybear_dask/model_selection/GSTCV/_GSTCVDask/_validation/_y.py,sha256=puWaVFbNuIswwkZk3HUfka-o1djJcrEyDUIotBw0NrY,2010
|
|
23
|
+
pybear_dask/model_selection/GSTCV/__init__.py,sha256=K41yCp0pkyirNxEueYIA-O6U4LLrnCub2oX4OluAxX8,59
|
|
24
|
+
pybear_dask/model_selection/__init__.py,sha256=57kwF8zDBZkxOMNVKGS1DwtZ0YQAEfGmI14h3CXx0gc,329
|
|
25
|
+
pybear_dask/model_selection/autogridsearch/AutoGSTCVDask.py,sha256=th1sjvPx4_r-d0DKKZxFTmnkrjs5vmwJl0txPRxwm4M,1393
|
|
26
|
+
pybear_dask/model_selection/autogridsearch/AutoGridSearchCVDask.py,sha256=KjDntQHVf5Ws-jTN-zKpNeIFYK1gequY74rHxRzOu34,1395
|
|
27
|
+
pybear_dask/model_selection/autogridsearch/__init__.py,sha256=D_kddLO_JM-RqnUWGnAWxlQtwnw4O7U4gTGuiLpvfJY,73
|
|
28
|
+
pybear_dask/model_selection/autogridsearch/_autogridsearch_wrapper/__init__.py,sha256=K41yCp0pkyirNxEueYIA-O6U4LLrnCub2oX4OluAxX8,59
|
|
29
|
+
pybear_dask/model_selection/autogridsearch/_autogridsearch_wrapper/_refit_can_be_skipped.py,sha256=rocltnKZumdqx5KceaRqrB844Zm26jFHeG6lrPhsPyw,3524
|
|
30
|
+
pybear_dask-0.2.0.dist-info/LICENSE,sha256=QNNeZHQINBvoYbT8uTaiayuM-iyWOwj32Sn0iw3iB3M,1496
|
|
31
|
+
pybear_dask-0.2.0.dist-info/METADATA,sha256=Fvk9_7zjAa0HiEE06cayD9PDy5uCHbHw07IYnGzKHa4,8076
|
|
32
|
+
pybear_dask-0.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
33
|
+
pybear_dask-0.2.0.dist-info/RECORD,,
|