Skip to main content
Python Suite research packages logo

gp3mlpy

Governance-first, leakage-resistant predictive modelling for Gazepoint research workflows in Python.

CI Documentation Coverage PyPI Python DOI License

Documentation · PyPI · API reference · Articles · Zenodo


gp3mlpy is the Python port of gp3ml 0.3.0. It brings the R package's governance-first modelling contracts to Python while keeping the scientific target, leakage controls, group structure, uncertainty, transportability, and reporting evidence explicit.

It is built for declared research questions and explicitly observed, non-sensitive outcomes. It is deliberately not an AutoML system: it will not silently change the generalization target, fit preprocessing on assessment data, invent a threshold, or relax governance constraints simply to produce a better-looking model.

Why use gp3mlpy?

Principle What the package enforces
Scientific target first Participant, stimulus, and participant–stimulus generalization are declared before resampling.
Leakage resistance Preprocessing, tuning, calibration, threshold selection, and uncertainty operations stay inside the correct partition.
Group-aware validation Splits that contradict the declared independence target are rejected rather than silently accepted.
Auditability Feature manifests, diagnostics, model cards, external-validation reports, checksums, handoffs, and release evidence are first-class objects.
Visible model selection Candidate models and decision rules remain inspectable; no hidden winner selection is performed.
Precise parity claims API, semantic, numerical, and algorithmic parity are described separately instead of being conflated.

Install

python -m pip install gp3mlpy

Optional extras are available for xgboost, deep-learning backends, conformal prediction, RO-Crate export, and safe model-artifact workflows.

python -m pip install "gp3mlpy[xgboost]"
python -m pip install "gp3mlpy[conformal]"
python -m pip install "gp3mlpy[artifact]"

A governed workflow in a few steps

import gp3mlpy as gp

predictors = [
    "tracking_ratio",
    "blink_rate",
    "fixation_duration",
    "gaze_dispersion",
    "pupil_change",
]

data = gp.simulate_gazepoint_governed_data(
    n_participants=18,
    n_stimuli=4,
    trials_per_cell=1,
    seed=17,
)

task = gp.create_gazepoint_synthetic_task(
    data,
    workflow="assigned_condition",
    generalization_target="new_participants",
)

manifest = gp.create_gazepoint_synthetic_manifest(task.outcome, predictors)

folds = gp.create_gazepoint_group_folds(
    data=data,
    outcome=task.outcome,
    predictors=predictors,
    feature_manifest=manifest,
    generalization_target=task.generalization_target,
    participant_id=task.participant_id,
    trial_id=task.unit_id,
    stimulus_id=task.stimulus_id,
    v=3,
    repeats=1,
    seed=17,
)

evaluation = gp.evaluate_gazepoint_group_folds(
    folds,
    task,
    predictors,
    engine="glm",
    seed=17,
)

assert gp.validate_gazepoint_resample_evaluation(evaluation).status == "pass"

The full workflow extends from task declaration and feature provenance through grouped/nested resampling, calibration, decision governance, robustness, external validation, reproducibility, and release evidence.

Release quality

Release property Validated baseline
gp3mlpy release 0.1.1
Frozen R reference gp3ml 0.3.0
Compatibility exports 127
Stable exports 71
Stable public classes 38
Python tests 125 passing
Statement coverage 4,020 / 4,020 — 100%
Branch coverage 1,700 / 1,700 — 100%
Partial branches 0
Stable behavioral parity 67 PASS / 4 EXPECTED-DIFFERENCE / 0 PENDING / 0 FAIL

Coverage is permanently enforced in CI with --cov-branch --cov-fail-under=100. The core test matrix runs on Ubuntu, Windows, and macOS across Python 3.11, 3.12, and 3.13, alongside Ruff, mypy, strict documentation builds, package build/Twine checks, and installed-wheel API validation.

Frozen R/Python behavioral parity

The 71-export stable API has a completed executable behavioral freeze against the SHA-256-verified gp3ml 0.3.0 release archive.

The four documented expected differences are intentional safety/reference-defect boundaries:

  1. Python rejects unequal calibration-vector lengths where frozen R recycles them.
  2. Python rejects shortened probability vectors where frozen R recycles them.
  3. Python returns the intended repeat-level uncertainty summary instead of reproducing the frozen-R repeat formula defect.
  4. Python keeps a functioning release-model-card Markdown writer instead of reproducing the frozen-R partial-matching defect.

These are not unresolved parity failures. See PARITY_STATUS.md and the executable evidence under parity/.

Choose your starting point

Goal Start here
Understand the design philosophy Key concepts
Run an end-to-end analysis Integrated research workflow
Validate new participants Participant generalization
Use nested grouped resampling Nested grouped resampling
Audit shift / external validity Dataset shift and robustness
Govern thresholds and decisions Decision governance
Build reproducible release evidence Reproducibility hardening
Find a function quickly Workflow API map · Full API index

Scientific safeguards

gp3mlpy preserves the prohibited-use boundary of the upstream package. It must not be used for person identification, biometric authentication, protected-attribute inference, health or diagnosis inference, or direct/indirect inference of emotion, stress, personality, deception, cognition, comprehension, intent, or other mental states.

See PROHIBITED-USE.md and GOVERNANCE.md before adapting the package to a new research context.

Citation

If you use gp3mlpy, cite the software release and the upstream gp3ml package.

Balaskas, S. (2026). gp3mlpy (Version 0.1.1) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.22206729

Machine-readable citation metadata are provided in CITATION.cff.

Development and reproducibility

git clone https://github.com/stefanosbalaskas/gp3mlpy.git
cd gp3mlpy
python -m pip install -e ".[dev,docs]"
python -m pytest --cov=gp3mlpy --cov-branch --cov-fail-under=100

The repository also contains the frozen R/Python parity harness, reference inventories, runnable examples, documentation-generation scripts, governance files, and release evidence.

Upstream reference

License

MIT © 2026 Stefanos Balaskas.

Metadata

Release files for gp3mlpy 0.1.1

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

Source distribution (sdist)

Source distribution for gp3mlpy 0.1.1
File Size Uploaded
gp3mlpy-0.1.1.tar.gz 575.8 kB Details

Built distribution (wheel)

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

Total release size: 720.8 kB

Release files / gp3mlpy-0.1.1.tar.gz

Download URL gp3mlpy-0.1.1.tar.gz
Size 575.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6d3d173406149250c3228d4aef4a83e4547b3d41f6532fbb76cd54f897bd3bbf
BLAKE2b-256 checksum
How to use checksums
c3f0e6a07128860929f17c27221d5a90943834d9d833e3c913b4a2367b3f78b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / gp3mlpy-0.1.1-py3-none-any.whl

Download URL gp3mlpy-0.1.1-py3-none-any.whl
Size 145.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e42825dc9ec524eea5df2c07b912a7a9b80c087b065d43fa52c6ae5cb810665
BLAKE2b-256 checksum
How to use checksums
eb28bf0cdd9c9368776889adcbd891a62ba94d9c8101f850988e1ddd78613f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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