Skip to main content

gp3mlpy

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

CI Documentation Coverage Python R reference Release License


gp3mlpy is the Python port of gp3ml 0.3.0, the governance-first R package for leakage-resistant and group-aware predictive modelling with Gazepoint-derived research data.

It is designed for explicitly observed, non-sensitive outcomes and declared scientific purposes. It is not an AutoML system: it does not silently choose a winning model, weaken participant/stimulus grouping, fit preprocessing on assessment data, invent a threshold, or relax provenance and external-validation requirements to make an analysis succeed.

Start here Link
Documentation https://stefanosbalaskas.github.io/gp3mlpy/
Key concepts https://stefanosbalaskas.github.io/gp3mlpy/key-concepts/
Plot gallery https://stefanosbalaskas.github.io/gp3mlpy/plots/
Articles https://stefanosbalaskas.github.io/gp3mlpy/articles/
API map https://stefanosbalaskas.github.io/gp3mlpy/api-map/
Complete API index https://stefanosbalaskas.github.io/gp3mlpy/reference/
R reference package https://CRAN.R-project.org/package=gp3ml

Frozen compatibility target

The port tracks gp3ml 0.3.0 as its frozen reference layer:

  • 127 exported functions — 71 stable and 56 experimental;
  • 38 stable public object classes;
  • 16 registered plot contracts;
  • 20 article/vignette companions;
  • explicit API, object-schema, failure, reproducibility, and governance contracts.

gp3mlpy.r_reference_version is "0.3.0". Machine-readable inventories are stored under reference/, alongside deterministic reference-layer tooling.

Current quality floor

The release baseline is continuously checked rather than described informally:

  • 125 passing Python tests;
  • 100% statement coverage — 4,020 / 4,020 executable statements;
  • 100% branch coverage — 1,700 / 1,700 branches with zero partial branches;
  • permanent CI enforcement with --cov-branch --cov-fail-under=100;
  • Ubuntu, Windows, and macOS across Python 3.11, 3.12, and 3.13;
  • Ruff semantic lint and public-stub mypy validation;
  • strict MkDocs build and generated documentation assets;
  • sdist/wheel build, Twine checks, and fresh installed-wheel frozen-API smoke testing; and
  • completed stable-API R/Python behavioral freeze against the SHA-256-verified gp3ml 0.3.0 release archive.

The frozen 71-export stable matrix is 67 PASS / 4 EXPECTED-DIFFERENCE / 0 PENDING / 0 FAIL. The four expected differences are documented safety/reference-defect boundaries: unequal calibration-vector recycling, shortened classification-probability recycling, the frozen-R repeat-level uncertainty defect, and the frozen-R release-model-card Markdown writer defect. Python retains the safer or functioning behavior rather than reproducing those reference defects.

Coverage is a Python-side quality property and stable-API behavioral parity is not a blanket claim of bitwise or algorithmic identity. API, semantic, numerical, and algorithmic parity remain separate claims, especially where Python-native backends differ from the R engines.

Why gp3mlpy

Generalization is part of the scientific claim

Participant, stimulus, and participant–stimulus generalization targets imply different independence requirements. Overlap that contradicts the declared target is a validation failure rather than a convenient fallback.

Leakage-sensitive operations remain local

Fitted preprocessing, tuning, calibration, threshold selection, and related operations stay inside the appropriate analysis/fold structure. External and assessment data are not allowed to influence fitting.

Important choices become auditable objects

The package provides feature-provenance manifests, leakage audits, grouped holdouts, repeated and nested resampling, fold diagnostics, governed model engines, uncertainty summaries, external-validation/transportability reports, decision rules, conformal prediction, shift audits, analysis plans, model artifacts, reproducibility checks, handoffs, RO-Crate export, model cards, and release evidence.

Parity is described precisely

Parity is separated into API, semantic, numerical, and algorithmic parity. Python-native adapters are not falsely described as bitwise-identical when the underlying implementation differs. In particular, current ranger and nnet labels preserve gp3ml governance/interface semantics while using scikit-learn backends rather than claiming algorithmic identity with the R engines.

Scientific safeguards

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

Participant overlap is a failure when the declared target requires new-participant generalization. Stimulus overlap is a failure when the target requires unseen stimuli. Threshold origin, uncertainty unit, calibration source, and analysis partition remain explicit and inspectable.

Installation

PyPI

python -m pip install gp3mlpy

Install directly from GitHub

python -m pip install "git+https://github.com/stefanosbalaskas/gp3mlpy.git@main"

Development checkout

git clone https://github.com/stefanosbalaskas/gp3mlpy.git
cd gp3mlpy
python -m pip install -e .

or, with uv:

uv sync --extra dev --extra docs

Optional extras include xgboost, deep, conformal, rocrate, and artifact.

Minimal governed workflow

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"

Visual diagnostics

The documentation site contains a generated plot gallery built from the current Python package. Plot contracts cover decision thresholds, abstention, conformal coverage, dataset shift, environment comparison, handoff/model-artifact/research-bundle validation, API stability, robustness, analysis-plan deviations, checksums, governance evidence, reproducibility, and engine portability.

Documentation and runnable articles

All 127 compatibility exports have dedicated reference pages. The 20 gp3ml 0.3.0 vignette topics have Python article companions, with runnable scripts under examples/ and CI coverage for the example suite.

Useful entry points:

Model-artifact security

gp3mlpy does not silently deserialize arbitrary pickle/joblib files. In-memory model-artifact validation is supported, and persisted artifacts should use an explicitly safe/native engine format or an audited optional persistence backend such as skops where supported.

Upstream reference

License

MIT © 2026 Stefanos Balaskas.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gp3mlpy-0.1.0.tar.gz (575.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gp3mlpy-0.1.0-py3-none-any.whl (145.3 kB view details)

Uploaded Python 3

File details

Details for the file gp3mlpy-0.1.0.tar.gz.

File metadata

  • Download URL: gp3mlpy-0.1.0.tar.gz
  • Upload date:
  • Size: 575.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gp3mlpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42d82d8740d515d11ac9829539d07d95145b9183214432bdad93818b6c25c353
MD5 5412c0a24b3156807bfab358a2b8bb18
BLAKE2b-256 d790fe39c662f84403d24460df617773131772fb288de1a1691005e8050256c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gp3mlpy-0.1.0.tar.gz:

Publisher: publish.yml on stefanosbalaskas/gp3mlpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gp3mlpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gp3mlpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 145.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gp3mlpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a6e1a3b7349a3f1f6f36aabfac604afee34111ba01be9f78f117613b0fc446d
MD5 8cb84292f80f3fa27cf60ac3bf7fbcf6
BLAKE2b-256 ec0fda8a17342e1e8bbe6f8e4b1980ad61acf6ae2e1135b352738a301cef31b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gp3mlpy-0.1.0-py3-none-any.whl:

Publisher: publish.yml on stefanosbalaskas/gp3mlpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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