SKSurrogate 0.1.0__tar.gz → 0.2.0__tar.gz

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.
Files changed (100) hide show
  1. sksurrogate-0.2.0/License.txt +21 -0
  2. sksurrogate-0.2.0/MANIFEST.in +10 -0
  3. {sksurrogate-0.1.0/SKSurrogate.egg-info → sksurrogate-0.2.0}/PKG-INFO +35 -13
  4. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/__init__.py +2 -0
  5. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/aml.py +6 -1
  6. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/structsearch.py +26 -10
  7. sksurrogate-0.2.0/SKSurrogate.egg-info/PKG-INFO +161 -0
  8. sksurrogate-0.2.0/SKSurrogate.egg-info/SOURCES.txt +95 -0
  9. sksurrogate-0.2.0/SKSurrogate.egg-info/requires.txt +21 -0
  10. sksurrogate-0.2.0/docs/Makefile +20 -0
  11. sksurrogate-0.2.0/docs/code.rst +61 -0
  12. sksurrogate-0.2.0/docs/conf.py +181 -0
  13. sksurrogate-0.2.0/docs/controlplane.rst +85 -0
  14. sksurrogate-0.2.0/docs/dataproc.rst +119 -0
  15. sksurrogate-0.2.0/docs/eoa.rst +187 -0
  16. sksurrogate-0.2.0/docs/hilbert.rst +128 -0
  17. sksurrogate-0.2.0/docs/images/best1.png +0 -0
  18. sksurrogate-0.2.0/docs/images/best10.png +0 -0
  19. sksurrogate-0.2.0/docs/images/best11.png +0 -0
  20. sksurrogate-0.2.0/docs/images/best12.png +0 -0
  21. sksurrogate-0.2.0/docs/images/best2.png +0 -0
  22. sksurrogate-0.2.0/docs/images/best3.png +0 -0
  23. sksurrogate-0.2.0/docs/images/best4.png +0 -0
  24. sksurrogate-0.2.0/docs/images/best5.png +0 -0
  25. sksurrogate-0.2.0/docs/images/best6.png +0 -0
  26. sksurrogate-0.2.0/docs/images/best7.png +0 -0
  27. sksurrogate-0.2.0/docs/images/best8.png +0 -0
  28. sksurrogate-0.2.0/docs/images/best9.png +0 -0
  29. sksurrogate-0.2.0/docs/images/correlations.png +0 -0
  30. sksurrogate-0.2.0/docs/images/funnel.png +0 -0
  31. sksurrogate-0.2.0/docs/images/lego.png +0 -0
  32. sksurrogate-0.2.0/docs/images/points.png +0 -0
  33. sksurrogate-0.2.0/docs/images/points_fit_optm.png +0 -0
  34. sksurrogate-0.2.0/docs/images/polyreg.png +0 -0
  35. sksurrogate-0.2.0/docs/images/ui-bundles.png +0 -0
  36. sksurrogate-0.2.0/docs/images/ui-dashboard.png +0 -0
  37. sksurrogate-0.2.0/docs/images/ui-datasets.png +0 -0
  38. sksurrogate-0.2.0/docs/images/ui-evaluation.png +0 -0
  39. sksurrogate-0.2.0/docs/images/ui-experiments.png +0 -0
  40. sksurrogate-0.2.0/docs/images/ui-features.png +0 -0
  41. sksurrogate-0.2.0/docs/images/ui-inference.png +0 -0
  42. sksurrogate-0.2.0/docs/images/ui-jobs.png +0 -0
  43. sksurrogate-0.2.0/docs/images/ui-monitoring.png +0 -0
  44. sksurrogate-0.2.0/docs/images/ui-quality-gates.png +0 -0
  45. sksurrogate-0.2.0/docs/images/ui-registry.png +0 -0
  46. sksurrogate-0.2.0/docs/images/ui-retraining.png +0 -0
  47. sksurrogate-0.2.0/docs/images/ui-settings.png +0 -0
  48. sksurrogate-0.2.0/docs/images/weights.png +0 -0
  49. sksurrogate-0.2.0/docs/index.rst +38 -0
  50. sksurrogate-0.2.0/docs/inference.rst +85 -0
  51. sksurrogate-0.2.0/docs/intro.rst +105 -0
  52. sksurrogate-0.2.0/docs/make.bat +36 -0
  53. sksurrogate-0.2.0/docs/mltrace.rst +425 -0
  54. sksurrogate-0.2.0/docs/modelbundles.rst +154 -0
  55. sksurrogate-0.2.0/docs/monitoring.rst +142 -0
  56. sksurrogate-0.2.0/docs/opd.rst +270 -0
  57. sksurrogate-0.2.0/docs/phase10.rst +122 -0
  58. sksurrogate-0.2.0/docs/phase9.rst +254 -0
  59. sksurrogate-0.2.0/docs/release.rst +44 -0
  60. sksurrogate-0.2.0/docs/sensitivity.rst +138 -0
  61. sksurrogate-0.2.0/docs/surrogate.rst +218 -0
  62. sksurrogate-0.2.0/docs/ui-manual.rst +490 -0
  63. sksurrogate-0.2.0/examples/benchmark_phase10.py +79 -0
  64. sksurrogate-0.2.0/examples/example01.py +79 -0
  65. sksurrogate-0.2.0/examples/example02.py +52 -0
  66. sksurrogate-0.2.0/examples/example03_mltrace.py +64 -0
  67. sksurrogate-0.2.0/examples/example04_end_to_end.py +70 -0
  68. sksurrogate-0.2.0/examples/example05_full_classification.py +142 -0
  69. sksurrogate-0.2.0/examples/example06_full_regression.py +141 -0
  70. sksurrogate-0.1.0/PKG-INFO → sksurrogate-0.2.0/readme.rst +8 -38
  71. sksurrogate-0.2.0/requirements.txt +22 -0
  72. sksurrogate-0.2.0/setup.py +77 -0
  73. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_optimized_paths.py +20 -12
  74. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase4_endpoints.py +13 -8
  75. sksurrogate-0.1.0/SKSurrogate.egg-info/SOURCES.txt +0 -31
  76. sksurrogate-0.1.0/SKSurrogate.egg-info/requires.txt +0 -13
  77. sksurrogate-0.1.0/setup.py +0 -48
  78. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/DataProcess.py +0 -0
  79. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/NpyProximation.py +0 -0
  80. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/ci.py +0 -0
  81. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/deployment.py +0 -0
  82. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/eoa.py +0 -0
  83. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/execution.py +0 -0
  84. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/inference.py +0 -0
  85. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/mltrace.py +0 -0
  86. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/modelbundle.py +0 -0
  87. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/monitoring.py +0 -0
  88. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/retraining.py +0 -0
  89. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/sensapprx.py +0 -0
  90. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate/synthdat.py +0 -0
  91. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate.egg-info/dependency_links.txt +0 -0
  92. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate.egg-info/entry_points.txt +0 -0
  93. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/SKSurrogate.egg-info/top_level.txt +0 -0
  94. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/setup.cfg +0 -0
  95. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase1_endpoints.py +0 -0
  96. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase2_endpoints.py +0 -0
  97. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase3_endpoints.py +0 -0
  98. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase5_endpoints.py +0 -0
  99. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase6_endpoints.py +0 -0
  100. {sksurrogate-0.1.0 → sksurrogate-0.2.0}/tests/test_phase7_endpoints.py +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Mehdi Ghasemi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,10 @@
1
+ include readme.rst
2
+ include License.txt
3
+ include requirements.txt
4
+ include docs/*.rst
5
+ include docs/conf.py
6
+ include docs/Makefile
7
+ include docs/make.bat
8
+ include docs/images/*
9
+ recursive-include examples *.py
10
+ recursive-include tests *.py conftest.py
@@ -1,35 +1,56 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SKSurrogate
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A python package that implements or wraps a few machine learning tools Scikit-Learn style.
5
5
  Home-page: https://github.com/mghasemi/sksurrogate.git
6
6
  Author: Mehdi Ghasemi
7
7
  Author-email: mehdi.ghasemi@gmail.com
8
- License: MIT License
8
+ License: MIT
9
9
  Keywords: Auto Machine Learning,AutoML,Optimization,Surrogate Optimization,Numerical,Machine Learning,Regression,Random Search
10
- Requires-Dist: numpy
11
- Requires-Dist: scipy
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/x-rst
21
+ Requires-Dist: numpy>=1.22
22
+ Requires-Dist: scipy>=1.10
12
23
  Requires-Dist: pandas
13
24
  Requires-Dist: matplotlib
14
- Requires-Dist: scikit-learn
25
+ Requires-Dist: scikit-learn>=1.5
15
26
  Requires-Dist: SALib
16
27
  Requires-Dist: imbalanced-learn
17
- Requires-Dist: joblib
28
+ Requires-Dist: joblib>=1.2
18
29
  Requires-Dist: eli5
19
30
  Requires-Dist: skrebate
20
- Requires-Dist: tqdm
31
+ Requires-Dist: tqdm>=4.66.3
21
32
  Requires-Dist: peewee
22
33
  Requires-Dist: category_encoders
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest; extra == "test"
36
+ Requires-Dist: pygments; extra == "test"
37
+ Provides-Extra: benchmark
38
+ Requires-Dist: openml<0.16,>=0.15; extra == "benchmark"
39
+ Requires-Dist: optuna; extra == "benchmark"
23
40
  Dynamic: author
24
41
  Dynamic: author-email
42
+ Dynamic: classifier
25
43
  Dynamic: description
44
+ Dynamic: description-content-type
26
45
  Dynamic: home-page
27
46
  Dynamic: keywords
28
47
  Dynamic: license
48
+ Dynamic: provides-extra
29
49
  Dynamic: requires-dist
50
+ Dynamic: requires-python
30
51
  Dynamic: summary
31
52
 
32
- |Quality| |Doc| |Licence|
53
+ |CI| |Doc| |Licence|
33
54
 
34
55
  |Logo|
35
56
 
@@ -39,9 +60,10 @@ SKSurrogate
39
60
  functions based on ``scikit-learn``. The main purpose of ``SKSurrogate`` is to facilitate
40
61
  hyperparameter optimization for machine learning models and optimized pipeline design (AutoML).
41
62
 
42
- The version of the surrogate optimization implemented here heavily relies on regressors.
43
- A custom regressor based on Hilbert Space techniques is implemented, but all ``scikit-learn``
44
- regressors are accepted for optimization.
63
+ The version of the surrogate optimization implemented here heavily relies on regressors. Since v0.2 the default
64
+ response surface is a stock, un-tuned RBF Gaussian process (chosen over the previous cubic Hilbert polynomial
65
+ on the evidence of the equal-budget benchmark suite); a custom regressor based on Hilbert Space techniques is
66
+ still available (`HilbertRegressor`), and all ``scikit-learn`` regressors are accepted for optimization.
45
67
 
46
68
  Finding an optimized pipeline -based on a given list of transformers and estimators is
47
69
  a time-consuming task. A version of evolutionary optimization has been implemented to reduce
@@ -130,8 +152,8 @@ MIT License
130
152
  SOFTWARE.
131
153
 
132
154
  .. |Logo| image:: ./docs/images/funnel.png
133
- .. |Quality| image:: https://api.codacy.com/project/badge/Grade/9a4d3e663cb04128a06d47efc85f23da
134
- :target: https://www.codacy.com/app/mghasemi/sksurrogate?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=mghasemi/sksurrogate&amp;utm_campaign=Badge_Grade
155
+ .. |CI| image:: https://github.com/mghasemi/sksurrogate/actions/workflows/ci.yml/badge.svg?branch=master
156
+ :target: https://github.com/mghasemi/sksurrogate/actions/workflows/ci.yml
135
157
  .. |Doc| image:: https://readthedocs.org/projects/sksurrogate/badge/?version=latest
136
158
  :target: https://sksurrogate.readthedocs.io/en/latest/?badge=latest
137
159
  :alt: Documentation Status
@@ -47,6 +47,8 @@ from .monitoring import (
47
47
  from .retraining import RetrainingJob
48
48
  from .synthdat import SynthData
49
49
 
50
+ __version__ = "0.2.0"
51
+
50
52
  __all__ = [
51
53
  "AML",
52
54
  "BoxSample",
@@ -229,7 +229,12 @@ default_config = {
229
229
  "class_weight": HDReal((1.0e-5, 1.0e-5), (20.0, 20.0)),
230
230
  },
231
231
  "sklearn.linear_model.LogisticRegression": {
232
- "penalty": Categorical(["l1", "l2"]),
232
+ # sklearn >= 1.8: 'penalty' is deprecated (removed in 1.10); L1/L2
233
+ # are now selected via l1_ratio, which constrains the solver
234
+ # (L1 needs liblinear/saga). The invalid (lbfgs, l1) cell is a
235
+ # forbidden combination handled by structsearch's fallback.
236
+ "solver": Categorical(["lbfgs", "liblinear"]),
237
+ "l1_ratio": Categorical([0.0, 1.0]),
233
238
  "C": Real(1.0e-6, 10.0),
234
239
  "class_weight": HDReal((1.0e-5, 1.0e-5), (20.0, 20.0))
235
240
  # 'dual': Categorical([True, False])
@@ -21,8 +21,11 @@ optimization problem with :math:`f` replaced by :math:`\hat{f}` one gets a more
21
21
  :math:`x_i` for the next iteration. If a certain number of iterations do not result in a better candidate,
22
22
  the method returns to random sampling to collect more information about :math:`f`. The surrogate
23
23
  function :math:`\hat{f}_i` can be found in many ways such as (non)linear regression, Gaussian
24
- process regression, etc. and `SurrogateSearch` do not have a preference. But by default it uses a polynomial
25
- regression of degree 3 if no regressor is provided. Any regressor following the architecture of `scikit-learn`
24
+ process regression, etc. and `SurrogateSearch` do not have a preference. But by default (since v0.2) it fits an
25
+ un-tuned RBF Gaussian process (`sklearn.gaussian_process.GaussianProcessRegressor`), chosen over the legacy cubic
26
+ Hilbert polynomial on the evidence of the equal-budget benchmark suite — see `benchmarks/DESIGN.md` sec. 12 and raw
27
+ records DOI 10.5281/zenodo.23629024; the Hilbert surface remains available via
28
+ `regressor=HilbertRegressor(deg=...)`. Any regressor following the architecture of `scikit-learn`
26
29
  is acceptable. Note that regressors usually require a minimum number of data points to function properly.
27
30
 
28
31
  There are various ways for sampling a random point in feasible space which affects the performance of SRS.
@@ -195,10 +198,12 @@ class SurrogateSearch(object):
195
198
  :param sampling: the sampling method either `BoxSample` or `SphereSample` (default `SphereSample`)
196
199
  :param search_sphere: `boolean` whether to fit the surrogate function on a neighbourhood of current candidate or
197
200
  over all sampled points (default: False)
198
- :param deg: `int` degree of polynomial regressor if one chooses to fit polynomial surrogates (default: 3)
201
+ :param deg: `int` degree used to compute the default minimum number of evaluations (default: 3); if you pass your own
202
+ polynomial surface, e.g. `regressor=HilbertRegressor(deg=...)`, that object's degree governs instead
199
203
  :param min_evals: `int` minimum number of samples before fitting a surrogate (default will be calculated as if the
200
204
  surrogate is a polynomial of degree 3)
201
- :param regressor: a regressor (scikit-learn style) to find a surrogate
205
+ :param regressor: a regressor (scikit-learn style) to find a surrogate; default since v0.2 is an un-tuned RBF
206
+ `GaussianProcessRegressor` — pass e.g. `HilbertRegressor(deg=3)` for the legacy cubic polynomial surface
202
207
  :param scipy_solver: `str` the scipy solver ('COBYLA' or 'SLSQP') to solve the local optimization problem at each
203
208
  iteration (default: 'COBYLA')
204
209
  :param max_itr_no_prog: `int` maximum number of iterations with no progress (default: infinity)
@@ -265,9 +270,16 @@ class SurrogateSearch(object):
265
270
  self.termination_reason = None
266
271
  self.summary_ = {}
267
272
  if self.regressor is None:
268
- from .NpyProximation import HilbertRegressor
269
-
270
- self.regressor = HilbertRegressor(deg=3)
273
+ # Default response surface since v0.2: stock, un-tuned RBF Gaussian process.
274
+ # Evidence: equal-budget benchmark suite (benchmarks/DESIGN.md sec. 12; raw
275
+ # records DOI 10.5281/zenodo.23629024) -- top mean CV on all six datasets at
276
+ # both B=30 and B=60 vs the legacy cubic Hilbert default (seed-level wins
277
+ # 20W/17T/5L and 25W/13T/4L). The MinEvals combinatorial floor below is kept
278
+ # identical to v0.1 so surrogate firing matches that benchmark configuration;
279
+ # pass regressor=HilbertRegressor(deg=<deg>) for the legacy surface.
280
+ from sklearn.gaussian_process import GaussianProcessRegressor
281
+
282
+ self.regressor = GaussianProcessRegressor()
271
283
  new_n_evals = binom(n_ + 3, n_)
272
284
  if self.MinEvals < new_n_evals:
273
285
  self.MinEvals = new_n_evals
@@ -677,6 +689,9 @@ class SurrogateRandomCV(BaseSearchCV):
677
689
  ``n_points`` if you want to try more parameter settings in parallel.
678
690
  :param min_evals: int, default=25; Number of random evaluations before employing an approximation for the
679
691
  response surface.
692
+ :param regressor: scikit-learn-style regressor used to fit the surrogate response surface;
693
+ default since v0.2 is an un-tuned RBF `GaussianProcessRegressor` (see
694
+ `benchmarks/DESIGN.md` sec. 12), pass e.g. `HilbertRegressor(deg=3)` for the legacy cubic polynomial.
680
695
  :param n_jobs: int, default=-1; number of processes to run in parallel
681
696
  :param fit_params: dict, optional; Parameters to pass to the fit method.
682
697
  :param pre_dispatch: int, or string, optional;
@@ -1307,9 +1322,10 @@ class SurrogateRandomCV(BaseSearchCV):
1307
1322
  best_params_[param] = cls_dict
1308
1323
  # The optimizer's solution can land inside a region every trial rejected
1309
1324
  # (a forbidden combination, or a candidate whose folds all failed).
1310
- # Refitting those settings either raises (e.g. lbfgs with penalty='l1')
1311
- # or silently returns a banned model, so fall back to the best trial that
1312
- # was actually completed; when no trial was, skip the refit entirely.
1325
+ # Refitting those settings either raises (e.g. an invalid
1326
+ # solver/regularization combination) or silently returns a banned
1327
+ # model, so fall back to the best trial that was actually completed;
1328
+ # when no trial was, skip the refit entirely.
1313
1329
  from numpy import isfinite
1314
1330
 
1315
1331
  feasible = [
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: SKSurrogate
3
+ Version: 0.2.0
4
+ Summary: A python package that implements or wraps a few machine learning tools Scikit-Learn style.
5
+ Home-page: https://github.com/mghasemi/sksurrogate.git
6
+ Author: Mehdi Ghasemi
7
+ Author-email: mehdi.ghasemi@gmail.com
8
+ License: MIT
9
+ Keywords: Auto Machine Learning,AutoML,Optimization,Surrogate Optimization,Numerical,Machine Learning,Regression,Random Search
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/x-rst
21
+ Requires-Dist: numpy>=1.22
22
+ Requires-Dist: scipy>=1.10
23
+ Requires-Dist: pandas
24
+ Requires-Dist: matplotlib
25
+ Requires-Dist: scikit-learn>=1.5
26
+ Requires-Dist: SALib
27
+ Requires-Dist: imbalanced-learn
28
+ Requires-Dist: joblib>=1.2
29
+ Requires-Dist: eli5
30
+ Requires-Dist: skrebate
31
+ Requires-Dist: tqdm>=4.66.3
32
+ Requires-Dist: peewee
33
+ Requires-Dist: category_encoders
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest; extra == "test"
36
+ Requires-Dist: pygments; extra == "test"
37
+ Provides-Extra: benchmark
38
+ Requires-Dist: openml<0.16,>=0.15; extra == "benchmark"
39
+ Requires-Dist: optuna; extra == "benchmark"
40
+ Dynamic: author
41
+ Dynamic: author-email
42
+ Dynamic: classifier
43
+ Dynamic: description
44
+ Dynamic: description-content-type
45
+ Dynamic: home-page
46
+ Dynamic: keywords
47
+ Dynamic: license
48
+ Dynamic: provides-extra
49
+ Dynamic: requires-dist
50
+ Dynamic: requires-python
51
+ Dynamic: summary
52
+
53
+ |CI| |Doc| |Licence|
54
+
55
+ |Logo|
56
+
57
+ SKSurrogate
58
+ ==================
59
+ ``SKSurrogate`` is a suite of tools which implements surrogate optimization for expensive
60
+ functions based on ``scikit-learn``. The main purpose of ``SKSurrogate`` is to facilitate
61
+ hyperparameter optimization for machine learning models and optimized pipeline design (AutoML).
62
+
63
+ The version of the surrogate optimization implemented here heavily relies on regressors. Since v0.2 the default
64
+ response surface is a stock, un-tuned RBF Gaussian process (chosen over the previous cubic Hilbert polynomial
65
+ on the evidence of the equal-budget benchmark suite); a custom regressor based on Hilbert Space techniques is
66
+ still available (`HilbertRegressor`), and all ``scikit-learn`` regressors are accepted for optimization.
67
+
68
+ Finding an optimized pipeline -based on a given list of transformers and estimators is
69
+ a time-consuming task. A version of evolutionary optimization has been implemented to reduce
70
+ its time in lieu of global optimality.
71
+
72
+ ``SKSurrogate`` is positioned as a scientific/research library: the numerical methods are
73
+ validated against benchmarks, but the API surface evolves with ongoing research work.
74
+
75
+ Installation
76
+ ------------
77
+ From PyPI::
78
+
79
+ pip install sksurrogate
80
+
81
+ or from source (development)::
82
+
83
+ pip install git+https://github.com/mghasemi/sksurrogate.git
84
+
85
+ Data identity and schema validation
86
+ -----------------------------------
87
+ ``SKSurrogate`` now records a deterministic dataset fingerprint and a JSON-serializable schema
88
+ for each tracked dataset. Each call to ``mltrack.RegisterData(...)`` stores dataset metadata,
89
+ including the target column, row count, column names, dtypes, nullability, and categorical values.
90
+ This allows a run to be identified and later compared against a different dataset or a refreshed
91
+ training sample.
92
+
93
+ The tracker also exposes ``validate_data(...)`` and ``validate_prediction_data(...)`` to compare
94
+ incoming data against the stored schema before training or inference. By default the checks are
95
+ strict: missing columns, reordered columns, dtype mismatches, and unknown categorical values fail
96
+ with actionable errors. For compatibility workflows, these checks can be relaxed explicitly with
97
+ ``missing_columns='ignore'`` or ``unknown_categories='ignore'``.
98
+
99
+ The intended workflow is:
100
+
101
+ 1. Register the training dataset with ``mltrack.RegisterData(frame, target)``.
102
+ 2. Validate training data before fitting with ``tracker.validate_data(frame, target=...)``.
103
+ 3. Validate prediction inputs with ``tracker.validate_prediction_data(frame)`` before calling
104
+ ``predict`` on a model or pipeline.
105
+ 4. Use the stored ``dataset_fingerprint`` and ``dataset_schema`` metadata for reproducibility,
106
+ drift checks, and auditability.
107
+
108
+ Dependencies
109
+ ----------------
110
+ ``SKSurrogate`` heavily depends on `NumPy <http://www.numpy.org/>`_,
111
+ `scipy <https://www.scipy.org/>`_, and `scikit-learn <https://scikit-learn.org/stable/>`_,
112
+ for its main functionalities. Other dependencies include `pandas <https://pandas.pydata.org/>`_,
113
+ `matplotlib <https://matplotlib.org/>`_, `SALib <https://github.com/SALib/SALib>`_,
114
+ `peewee <https://github.com/coleifer/peewee>`_, and
115
+ `tqdm <https://github.com/tqdm/tqdm>`_.
116
+
117
+ Documentation
118
+ ----------------
119
+ The documentation is produced by `Sphinx <http://www.sphinx-doc.org/en/stable/>`_ and is intended to cover code usage
120
+ as well as a bit of theory to explain each method briefly.
121
+ For more details refer to the documentation at `sksurrogate.rtfd.io <http://sksurrogate.readthedocs.io/>`_.
122
+ The optional web UI and control-plane API are documented in the
123
+ `Web UI and Control-Plane API guide <https://sksurrogate.readthedocs.io/en/latest/controlplane.html>`_.
124
+ The `step-by-step UI manual <https://sksurrogate.readthedocs.io/en/latest/ui-manual.html>`_
125
+ includes screenshots and example CSV files.
126
+
127
+ License
128
+ ================
129
+ This code is distributed under `MIT license <https://en.wikipedia.org/wiki/MIT_License>`_:
130
+
131
+ MIT License
132
+ ----------------
133
+
134
+ Copyright (c) 2019 Mehdi Ghasemi
135
+
136
+ Permission is hereby granted, free of charge, to any person obtaining a copy
137
+ of this software and associated documentation files (the "Software"), to deal
138
+ in the Software without restriction, including without limitation the rights
139
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
140
+ copies of the Software, and to permit persons to whom the Software is
141
+ furnished to do so, subject to the following conditions:
142
+
143
+ The above copyright notice and this permission notice shall be included in all
144
+ copies or substantial portions of the Software.
145
+
146
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
149
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
151
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
152
+ SOFTWARE.
153
+
154
+ .. |Logo| image:: ./docs/images/funnel.png
155
+ .. |CI| image:: https://github.com/mghasemi/sksurrogate/actions/workflows/ci.yml/badge.svg?branch=master
156
+ :target: https://github.com/mghasemi/sksurrogate/actions/workflows/ci.yml
157
+ .. |Doc| image:: https://readthedocs.org/projects/sksurrogate/badge/?version=latest
158
+ :target: https://sksurrogate.readthedocs.io/en/latest/?badge=latest
159
+ :alt: Documentation Status
160
+ .. |Licence| image:: https://img.shields.io/badge/license-MIT-blue.svg
161
+ :target: https://github.com/mghasemi/sksurrogate/blob/master/License.txt
@@ -0,0 +1,95 @@
1
+ License.txt
2
+ MANIFEST.in
3
+ readme.rst
4
+ requirements.txt
5
+ setup.py
6
+ SKSurrogate/DataProcess.py
7
+ SKSurrogate/NpyProximation.py
8
+ SKSurrogate/__init__.py
9
+ SKSurrogate/aml.py
10
+ SKSurrogate/ci.py
11
+ SKSurrogate/deployment.py
12
+ SKSurrogate/eoa.py
13
+ SKSurrogate/execution.py
14
+ SKSurrogate/inference.py
15
+ SKSurrogate/mltrace.py
16
+ SKSurrogate/modelbundle.py
17
+ SKSurrogate/monitoring.py
18
+ SKSurrogate/retraining.py
19
+ SKSurrogate/sensapprx.py
20
+ SKSurrogate/structsearch.py
21
+ SKSurrogate/synthdat.py
22
+ SKSurrogate.egg-info/PKG-INFO
23
+ SKSurrogate.egg-info/SOURCES.txt
24
+ SKSurrogate.egg-info/dependency_links.txt
25
+ SKSurrogate.egg-info/entry_points.txt
26
+ SKSurrogate.egg-info/requires.txt
27
+ SKSurrogate.egg-info/top_level.txt
28
+ docs/Makefile
29
+ docs/code.rst
30
+ docs/conf.py
31
+ docs/controlplane.rst
32
+ docs/dataproc.rst
33
+ docs/eoa.rst
34
+ docs/hilbert.rst
35
+ docs/index.rst
36
+ docs/inference.rst
37
+ docs/intro.rst
38
+ docs/make.bat
39
+ docs/mltrace.rst
40
+ docs/modelbundles.rst
41
+ docs/monitoring.rst
42
+ docs/opd.rst
43
+ docs/phase10.rst
44
+ docs/phase9.rst
45
+ docs/release.rst
46
+ docs/sensitivity.rst
47
+ docs/surrogate.rst
48
+ docs/ui-manual.rst
49
+ docs/images/best1.png
50
+ docs/images/best10.png
51
+ docs/images/best11.png
52
+ docs/images/best12.png
53
+ docs/images/best2.png
54
+ docs/images/best3.png
55
+ docs/images/best4.png
56
+ docs/images/best5.png
57
+ docs/images/best6.png
58
+ docs/images/best7.png
59
+ docs/images/best8.png
60
+ docs/images/best9.png
61
+ docs/images/correlations.png
62
+ docs/images/funnel.png
63
+ docs/images/lego.png
64
+ docs/images/points.png
65
+ docs/images/points_fit_optm.png
66
+ docs/images/polyreg.png
67
+ docs/images/ui-bundles.png
68
+ docs/images/ui-dashboard.png
69
+ docs/images/ui-datasets.png
70
+ docs/images/ui-evaluation.png
71
+ docs/images/ui-experiments.png
72
+ docs/images/ui-features.png
73
+ docs/images/ui-inference.png
74
+ docs/images/ui-jobs.png
75
+ docs/images/ui-monitoring.png
76
+ docs/images/ui-quality-gates.png
77
+ docs/images/ui-registry.png
78
+ docs/images/ui-retraining.png
79
+ docs/images/ui-settings.png
80
+ docs/images/weights.png
81
+ examples/benchmark_phase10.py
82
+ examples/example01.py
83
+ examples/example02.py
84
+ examples/example03_mltrace.py
85
+ examples/example04_end_to_end.py
86
+ examples/example05_full_classification.py
87
+ examples/example06_full_regression.py
88
+ tests/test_optimized_paths.py
89
+ tests/test_phase1_endpoints.py
90
+ tests/test_phase2_endpoints.py
91
+ tests/test_phase3_endpoints.py
92
+ tests/test_phase4_endpoints.py
93
+ tests/test_phase5_endpoints.py
94
+ tests/test_phase6_endpoints.py
95
+ tests/test_phase7_endpoints.py
@@ -0,0 +1,21 @@
1
+ numpy>=1.22
2
+ scipy>=1.10
3
+ pandas
4
+ matplotlib
5
+ scikit-learn>=1.5
6
+ SALib
7
+ imbalanced-learn
8
+ joblib>=1.2
9
+ eli5
10
+ skrebate
11
+ tqdm>=4.66.3
12
+ peewee
13
+ category_encoders
14
+
15
+ [benchmark]
16
+ openml<0.16,>=0.15
17
+ optuna
18
+
19
+ [test]
20
+ pytest
21
+ pygments
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = python -msphinx
7
+ SPHINXPROJ = SKSurrogate
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,61 @@
1
+ Code Documentation
2
+ =================================
3
+
4
+ This reference covers the public ``SKSurrogate`` API that users are expected to
5
+ import from the package root. The package exposes the stable automation and
6
+ tracking interfaces directly, while the internal implementation modules remain
7
+ available for advanced usage.
8
+
9
+ .. currentmodule:: SKSurrogate
10
+
11
+ .. automodule:: SKSurrogate
12
+ :members:
13
+ :undoc-members:
14
+ :show-inheritance:
15
+
16
+ The package also exposes the major implementation modules for advanced users:
17
+
18
+ .. automodule:: SKSurrogate.structsearch
19
+ :members:
20
+
21
+ .. automodule:: SKSurrogate.eoa
22
+ :members:
23
+
24
+ .. automodule:: SKSurrogate.NpyProximation
25
+ :members:
26
+
27
+ .. automodule:: SKSurrogate.sensapprx
28
+ :members:
29
+
30
+ .. automodule:: SKSurrogate.aml
31
+ :members:
32
+
33
+ .. automodule:: SKSurrogate.mltrace
34
+ :members:
35
+
36
+ .. automodule:: SKSurrogate.modelbundle
37
+ :members:
38
+
39
+ .. automodule:: SKSurrogate.inference
40
+ :members:
41
+
42
+ .. automodule:: SKSurrogate.monitoring
43
+ :members:
44
+
45
+ .. automodule:: SKSurrogate.execution
46
+ :members:
47
+
48
+ .. automodule:: SKSurrogate.ci
49
+ :members:
50
+
51
+ .. automodule:: SKSurrogate.retraining
52
+ :members:
53
+
54
+ .. automodule:: SKSurrogate.deployment
55
+ :members:
56
+
57
+ .. automodule:: SKSurrogate.DataProcess
58
+ :members:
59
+
60
+ .. automodule:: SKSurrogate.synthdat
61
+ :members: