Skip to content
المشاريع

حول

FairLendKit is a reproducible fair-lending audit toolkit for credit decisioning systems. It helps model-risk, responsible-AI, validation, and data-science teams turn explicitly configured credit data into review-ready group metrics, reliability states, uncertainty intervals, screening flags, and typed audit records.

مشاريع أخرى

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
+١٢
خلال 15 يومًا
+٨٩
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

FairLendKit

FairLendKit is a reproducible fair-lending audit toolkit for credit decisioning systems. It helps model-risk, responsible-AI, validation, and data-science teams turn explicitly configured credit data into review-ready group metrics, reliability states, uncertainty intervals, screening flags, and typed audit records.

Use FairLendKit when you need to preserve the meaning of outcomes, scores, decisions, audit groups, and reference comparisons while handling sparse or undefined metrics explicitly. The project is designed for reproducible practitioner review using public, synthetic, or appropriately governed internal data. It does not determine legal compliance and does not provide legal advice.

Why FairLendKit

Metric libraries can calculate rates and ratios, but a defensible audit also needs semantic validation, stable comparison direction, explicit undefined states, reliability gates, uncertainty, provenance, and reproducible output. FairLendKit connects those layers in one typed core without turning a statistical screen into a legal conclusion.

It differs from a general-purpose fairness-metrics collection in three ways:

  • credit decision semantics are configured and validated rather than inferred;
  • unreliable, undefined, and not-applicable results remain first-class states;
  • deterministic inputs, bootstrap streams, Schema 2.0 output, and checked-in oracles support independent reproduction.

Implemented capability

The current pre-alpha core accepts one pandas DataFrame and one immutable AuditConfig through run_audit(data, config). It provides:

  • layered structural, semantic, reliability, and data-quality validation;
  • deterministic overall and single-protected-attribute group metrics;
  • explicit directed reference comparisons;
  • typed undefined, not-applicable, unreliable, and reliable states;
  • deterministic SHA-256 counter bootstrap intervals;
  • reliability-gated adverse-impact-ratio screening prompts;
  • renderer-neutral AuditResult Schema 2.0 JSON serialization; and
  • a strict Schema 1.0 parser with explicit lossless 1.0-to-2.0 migration.

The engine does not make fairness, legal, or compliance determinations. A screening flag is a prompt for practitioner review, not a pass/fail result.

Quick start

Install the package and test dependencies from a checkout:

python -m pip install -e '.[test]'

Run the checked-in synthetic example:

python examples/synthetic/run_audit.py > audit-result-v2.json

The script uses a fixed execution timestamp, bootstrap seed, configuration, and synthetic rows. Repeated runs in the same supported locked environment produce byte-identical compact JSON serialization. This is a project serialization contract, not a claim of conformance to an external JSON standard. The result fingerprint intentionally includes dataframe row order, index, columns, and dtypes.

The release-gate SHA-256 of the exact example stdout, including its final newline, is:

43c196e36cd3509fce3e4be0ca4cd624e5e233ad4a6c9ad6df01f0bffe499c76

From a clean checkout, the single release-verification entry point creates a temporary virtual environment with python -m venv, installs the exact versions in the pinned release requirement files, verifies the final pip freeze, generates and byte-compares the compact JSON serialization, checks its digest, runs the full suite and architecture checks, and verifies the diff:

./scripts/verify_milestone3_release.sh

Set PYTHON=python3.11 or PYTHON=python3.12 to select a supported runtime. The command exits non-zero if generated bytes differ from the checked-in audit-result-v2.json oracle or its fixed SHA-256. CI runs the same verifier on both supported versions.

Programmatic use starts with:

from fairlendkit import AuditConfig, AuditResult, run_audit

result: AuditResult = run_audit(data, config)
payload = result.model_dump_json()

Run the Milestone 4 user workflow from an installed checkout:

fairlendkit audit \
  --data examples/workflow/credit.csv \
  --config examples/workflow/audit-config.json \
  --output reports/example

The command writes canonical Schema 2.0 JSON, a metrics CSV projection, and a self-contained HTML review report. Existing selected artifacts are protected; use --overwrite only when replacement is intentional. Use repeated --format options to request a subset, for example --format json --format html.

See examples/synthetic/run_audit.py for a complete configuration and dataframe. The existing audit-result.json is retained as the Schema 1.0 compatibility and migration fixture; it is not current writer output.

Explicitly not implemented

The following remain future milestones and are not exposed by the current core:

  • threshold scanning or a fairness-accuracy frontier;
  • a notebook workflow beyond the checked-in command-line example;
  • governance integration or investigation lifecycle tooling; and
  • mitigation, reweighing, threshold recommendations, or model retraining.

The release-candidate alternative-data APIs are available from fairlendkit.alternative_data. They provide caller-configured validation, quality evidence, signal profiles, risk diagnostics, and potential proxy-risk screening through disclosure-controlled typed releases. They do not connect to, download, admit, or redistribute real consumer data, and they do not make credit, causal, discrimination, legal, or compliance determinations.

See the Product brief, Product requirements, Canonical glossary, Architecture, Metric contracts, Undefined reasons, Report schema, Methodology and guardrails, and Roadmap.

For a topic-oriented introduction, start with Core concepts, then consult the FAQ, limitations and responsible use, and citation and research relationship.

Implementation is tracked as ordered, testable work packages in the V1 implementation plan.

Status

Pre-alpha. Milestone 3 core audit engine and reliability contracts are implemented. Milestone 4 is closed: the installed CLI and JSON, CSV, and HTML reporting workflow passed independent review and Python 3.11/3.12 CI before PR #46 merged. The AD-0 through AD-4 alternative-data implementation is now a release candidate exposed through fairlendkit.alternative_data; it remains synthetic/caller-input only and does not authorize any live data operation.

Milestone 3 release evidence

  • Public entry point: run_audit(data, config) from the package root.
  • Current writer: strict AuditResult Schema 2.0.
  • Compatibility: strict Schema 1.0 parser and explicit lossless migration.
  • Determinism: fixed synthetic input, config, timestamp, seed, JSON order, and SHA-256 oracle above.
  • Architecture: application orchestration is adapter-neutral; pandas and the concrete bootstrap estimator are composed only at the outer API boundary.
  • Runtime gate: full tests on Python 3.11 and 3.12 plus git diff --check.
  • Historical scope gate: at Milestone 3 closure the repository exported no CLI, HTML/CSV renderer, threshold scan, proxy screening, governance integration, or mitigation workflow. Milestone 4 intentionally supersedes the first two exclusions without changing the analytical scope.

The complete checked-in verification record is docs/milestone-3-release-evidence.md.

The Milestone 4 closure evidence is recorded in docs/milestone-4-release-evidence.md.

Citation

Until a DOI-backed release is published, cite the repository and pin the exact version or commit used. GitHub and reference managers can read CITATION.cff; machine-readable software metadata is also available in codemeta.json. See Citation and research relationship for scope and paper-version guidance.

Licensing and contributing

FairLendKit is licensed under the Apache License 2.0. See Contributing before proposing changes. Repository discovery metadata must never advertise a roadmap item as an implemented capability.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…