Skip to main content

CI Documentation Status Licence

Logo

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. Since v0.2 the default response surface is a stock, un-tuned RBF Gaussian process (chosen over the previous cubic Hilbert polynomial on the evidence of the equal-budget benchmark suite); a custom regressor based on Hilbert Space techniques is still available (HilbertRegressor), and 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:

  1. Register the training dataset with mltrack.RegisterData(frame, target).

  2. Validate training data before fitting with tracker.validate_data(frame, target=...).

  3. Validate prediction inputs with tracker.validate_prediction_data(frame) before calling predict on a model or pipeline.

  4. 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.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SKSurrogate 0.2.0
File Size Uploaded Provenance Actions
sksurrogate-0.2.0.tar.gz 3.5 MB Without provenance Details for sksurrogate-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SKSurrogate 0.2.0
File Interpreter ABI Platform Actions
sksurrogate-0.2.0-py3-none-any.whl Python 3 none any Details for sksurrogate-0.2.0-py3-none-any.whl

Total release size: 3.6 MB

Release files / sksurrogate-0.2.0.tar.gz

Download URL sksurrogate-0.2.0.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
4013c69493da45711a42a43739095a36281d9e0f423661292b149ebd50a0596c
BLAKE2b-256 checksum
How to use checksums
bf3f3aa36c81b5679cf1ac683421997f222a7069f788c14e1b6a2b608882ca04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / sksurrogate-0.2.0-py3-none-any.whl

Download URL sksurrogate-0.2.0-py3-none-any.whl
Size 87.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b35b095cfe9f05469d64166e37e07fc50f325e650bb361672585c9cb2e4b37f4
BLAKE2b-256 checksum
How to use checksums
92449028abf7a8fc960a7c32858e2e5fdc01701b1fe7a87b2b10c01966bb00d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for SKSurrogate 0.2.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page