SKSurrogate
SKSurrogate is a suite of tools which implements surrogate optimization for expensive functions based on scikit-learn. The main purpose of SKSurrogate is to facilitate hyperparameter optimization for machine learning models and optimized pipeline design (AutoML).
The version of the surrogate optimization implemented here heavily relies on regressors. A custom regressor based on Hilbert Space techniques is implemented, but all scikit-learn regressors are accepted for optimization.
Finding an optimized pipeline -based on a given list of transformers and estimators is a time-consuming task. A version of evolutionary optimization has been implemented to reduce its time in lieu of global optimality.
SKSurrogate is positioned as a scientific/research library: the numerical methods are validated against benchmarks, but the API surface evolves with ongoing research work.
Installation
From PyPI:
pip install sksurrogate
or from source (development):
pip install git+https://github.com/mghasemi/sksurrogate.git
Data identity and schema validation
SKSurrogate now records a deterministic dataset fingerprint and a JSON-serializable schema for each tracked dataset. Each call to mltrack.RegisterData(...) stores dataset metadata, including the target column, row count, column names, dtypes, nullability, and categorical values. This allows a run to be identified and later compared against a different dataset or a refreshed training sample.
The tracker also exposes validate_data(...) and validate_prediction_data(...) to compare incoming data against the stored schema before training or inference. By default the checks are strict: missing columns, reordered columns, dtype mismatches, and unknown categorical values fail with actionable errors. For compatibility workflows, these checks can be relaxed explicitly with missing_columns='ignore' or unknown_categories='ignore'.
The intended workflow is:
Register the training dataset with mltrack.RegisterData(frame, target).
Validate training data before fitting with tracker.validate_data(frame, target=...).
Validate prediction inputs with tracker.validate_prediction_data(frame) before calling predict on a model or pipeline.
Use the stored dataset_fingerprint and dataset_schema metadata for reproducibility, drift checks, and auditability.
Dependencies
SKSurrogate heavily depends on NumPy, scipy, and scikit-learn, for its main functionalities. Other dependencies include pandas, matplotlib, SALib, peewee, and tqdm.
Documentation
The documentation is produced by Sphinx and is intended to cover code usage as well as a bit of theory to explain each method briefly. For more details refer to the documentation at sksurrogate.rtfd.io. The optional web UI and control-plane API are documented in the Web UI and Control-Plane API guide. The step-by-step UI manual includes screenshots and example CSV files.
License
This code is distributed under MIT license:
MIT License
Copyright (c) 2019 Mehdi Ghasemi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for SKSurrogate 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sksurrogate-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for sksurrogate-0.1.1-py3-none-any.whl |
Release files / sksurrogate-0.1.1-py3-none-any.whl
| Download URL | sksurrogate-0.1.1-py3-none-any.whl |
|---|---|
| Size | 86.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f75aa9988076fe59f8765506389590872cd1f4389bdbd7a80f9fe4dd39eee91
|
|
BLAKE2b-256 checksum How to use checksums |
0dd6495772416484349ed1f23458a806dc3744dcf1ee886e36083f1f9835ad7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for SKSurrogate 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.