finreg-ml
Regulation-aware ML pipeline for finance. Train a model, get a compliance report.
Built for teams shipping ML in regulated industries (credit scoring, fraud detection, insurance pricing) who need explainability, fairness audits, and EU AI Act documentation as part of their workflow — not as an afterthought.
Installation
pip install finreg-ml
Quick Start
from finreg import GovernedModel
from sklearn.ensemble import GradientBoostingClassifier
# Wrap any sklearn-compatible estimator
model = GovernedModel(
estimator=GradientBoostingClassifier(),
protected_attributes=["age_group", "gender"],
risk_tier="high", # EU AI Act classification
model_name="CreditScorer",
)
# Train — metadata captured automatically
model.fit(X_train, y_train)
# Evaluate
metrics = model.evaluate(X_test, y_test)
# Explain — SHAP values auto-generated
explanations = model.explain(X_test)
print(explanations.top_features(5))
# Fairness audit — bias metrics across protected attributes
fairness = model.fairness_report(X_test, y_test)
for report in fairness:
print(f"{report.attribute}: disparate impact = {report.disparate_impact_ratio:.3f}")
# Compliance check — EU AI Act Article 13 assessment
compliance = model.compliance_report()
print(f"Compliant: {compliance.compliant}")
print(f"Passed: {compliance.passed}, Failed: {compliance.failed}")
# Export everything
model.model_card().to_json("model_card.json")
model.audit_log.to_json("audit_log.json")
compliance.to_json("compliance_report.json")
What It Does
| Module | Purpose |
|---|---|
GovernedModel |
Sklearn-compatible wrapper that captures training metadata automatically |
finreg.explain |
SHAP-based explanations and feature importance |
finreg.fairness |
Demographic parity, equalized odds, disparate impact (four-fifths rule) |
finreg.model_card |
Auto-generated model cards (Google Model Card spec) |
finreg.compliance |
EU AI Act compliance assessment (Articles 5, 10, 12, 13, 14, 15) |
finreg.audit |
Append-only audit log with SHA-256 integrity checksums |
EU AI Act Coverage
Checks against these articles for HIGH-risk systems:
- Article 5 — Prohibited AI practices detection
- Article 10 — Data governance requirements
- Article 12 — Automatic logging and traceability
- Article 13 — Transparency and explainability
- Article 14 — Human oversight mechanisms
- Article 15 — Accuracy metrics and bias testing
Fairness Metrics
For each protected attribute, computes:
- Demographic parity difference — gap in positive prediction rates across groups
- Equalized odds difference — gap in true positive rates
- Disparate impact ratio — ratio of lowest to highest positive rate
- Four-fifths rule — passes if disparate impact ratio >= 0.8
Development
git clone https://github.com/atharvajoshi01/finreg-ml.git
cd finreg-ml
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for finreg-ml 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| finreg_ml-0.1.0.tar.gz | 17.0 kB | Without provenance | Details for finreg_ml-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| finreg_ml-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for finreg_ml-0.1.0-py3-none-any.whl |
Total release size: 33.2 kB
Release files / finreg_ml-0.1.0.tar.gz
| Download URL | finreg_ml-0.1.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d551b041223ec2f19549f31bf37d4c9495e4b1a25365e85baff4dc8ae1024b8
|
|
BLAKE2b-256 checksum How to use checksums |
33ba05c15aef34d920ee0e4edaaf214837a01b6135d2aab15afa228b245977b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / finreg_ml-0.1.0-py3-none-any.whl
| Download URL | finreg_ml-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85b01448ec05decda648051d7320a6bc09d44125778475ce08b814a135509132
|
|
BLAKE2b-256 checksum How to use checksums |
9aa1d1165cdc97a3f7a95085403c549452a9d65e8b0b0d263621ad04e092f874
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for finreg-ml 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.