Skip to main content

researchlab

Research experiments are made of many layers and some pre-defined steps. Some common pre-defined artifacts:

  • Models
  • Datasets
  • Evaluation Policy: how to cross-validation, how to evaluate, etc, when to instantiate and fit models
  • Metrics

And some output artifacts:

  • Checkpoints
  • Logs
  • Plots
  • Metrics

This package provides a framework to define and run such experiments and to manage artifacts in a modular fashion. The structure allows easy use with different backends and helps with reproducibility and organization of experiments.

Components

For every component, the init arguments are mapped to public attributes with the exact same name and values provided at initialization. This allows for easy access to the configuration of each component and promotes transparency in the experiment setup. Pydantic is used to enforce type checking and validation of attributes. A get_params method, similar to scikit-learn, skbase and sktime, is provided with recursive support for nested components. This method returns a dictionary of all parameters and their values, allowing for easy inspection and debugging of the experiment configuration.

Evaluation Policy contract

Evaluation policy receives has a method:

  • evaluate(model, dataset, metrics): returns a dictionary of metric names and their values, given a model, a dataset and a list of metrics. The metrics are returned in a list for each key since evaluation policies usually involve cross-validation and thus return multiple values for each metric.

For a scikit-learn experiment, the cv is passed in __init__ and the evaluate method performs cross-validation using the provided cv and returns the metrics for each fold.

Evaluate can also return a key "_extra_info" with extra information.

Models contract

A Model is class that implements the following method:

  • instantiate: returns an instance of the model, ready to be fitted.

Each model has a name attribute that is used to identify the model in the results and artifacts. The name should be unique across different models used in the same experiment to avoid confusion in the results and artifacts. The name can be used in the storage to organize artifacts by model, making it easier to track and compare results across different models.

Dataset contract

A Dataset is a class that implements the following method:

  • load: returns the data.

Metrics contract

A Metric is a class that implements the following method:

  • evaluate(fitted_model, **kwargs): returns the value of the metric given a fitted model and any additional arguments needed for evaluation (e.g., test data, true labels, etc.). Returns a float or a dictionary of metric values.

Storage contract

A Storage is a class that implements the following methods:

  • save(key, value): saves a value exactly under the given key and must not create additional sidecar artifacts implicitly.
  • load(key): loads the value stored exactly at that key.
  • exists(key): returns True if that exact key exists in storage.
  • erase(key): removes only the value stored under that exact key.

Keys may contain slashes (e.g., "dataset/model") which backends may map to subdirectories. Artifact formats are part of the key, e.g. "dataset/model.pkl" and "dataset/model.csv".

Runner

Runner consolidates the evaluation policy, models, datasets, metrics, and storage to run the experiment. It provides a CLI via runner.cli() so that, when instantiated in a script, the experiment can be run from the command line with run, list, and erase commands accepting --dataset and --model filters.

Results from the evaluation policy are saved under two explicit keys per run: "{dataset.name}/{model.name}.csv" for the tabular metrics view and "{dataset.name}/{model.name}.pkl" for the full Python result object. The storage can be local (e.g., LocalStorage) or any custom backend implementing the Storage contract.

Metadata

Release files for researchlab 0.0.3

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

Source distribution (sdist)

Source distribution for researchlab 0.0.3
File Size Uploaded Provenance
researchlab-0.0.3.tar.gz 152.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for researchlab 0.0.3
File Interpreter ABI Platform
researchlab-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 184.3 kB

Release files / researchlab-0.0.3.tar.gz

Download URL researchlab-0.0.3.tar.gz
Size 152.3 kB
Tags Source
SHA-256 checksum
How to use checksums
85fa7826027df1895b7b414ac7464b0e33ef07829591dc30029d397fa70b9873
BLAKE2b-256 checksum
How to use checksums
572df1b4b6f09fb0d199942b1f214007f5a81f3a6de83e2c80eca896041e3b0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / researchlab-0.0.3-py3-none-any.whl

Download URL researchlab-0.0.3-py3-none-any.whl
Size 32.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e6263c857a6e5e6a0604c745fd776adac7e5230c87982034dfa255b3abf65d0
BLAKE2b-256 checksum
How to use checksums
467ceafba1095aef10ed6c9d3940b676ed0fdd86af8a382f607da388b19cdbcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for researchlab 0.0.3

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