Skip to main content

Quality 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. 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:

  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.1.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.1.0
File Size Uploaded Provenance Actions
sksurrogate-0.1.0.tar.gz 109.6 kB Without provenance Details for sksurrogate-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 196.3 kB

Release files / sksurrogate-0.1.0.tar.gz

Download URL sksurrogate-0.1.0.tar.gz
Size 109.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a184dae96499390445d58de37a5eaa25a572364ed18240fc8769c876d3b579ae
BLAKE2b-256 checksum
How to use checksums
00db1ae7471e007bcb9b8ff040d35ff44138304add9089d5c91a9851dd3e63f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

Download URL sksurrogate-0.1.0-py3-none-any.whl
Size 86.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6fb1d65b0fc477e1750e0b18298ca7580a7fffe954569598f0ab610e9e914af
BLAKE2b-256 checksum
How to use checksums
c6ce03456a9f79af0010c3804e7d894fa1617629e16ce0c663a0f32fd8c42c9a
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.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