Skip to content

TrustLens v0.4.0 — Framework-Agnostic Trustworthiness Platform

Latest

Choose a tag to compare

@Khanz9664 Khanz9664 released this 15 May 07:40
· 32 commits to main since this release
0dea480

🚀 TrustLens v0.4.0 — Framework-Agnostic Trustworthiness Platform

TrustLens v0.4.0 is a major architectural milestone that transforms TrustLens from a scikit-learn-focused extension into a framework-agnostic platform for ML trustworthiness evaluation.

This release introduces a new backend resolver architecture, native XGBoost support, improved auditability, stronger calibration correctness, and substantial production hardening — all while maintaining zero breaking changes for existing scikit-learn users.


🏛️ Framework-Agnostic Prediction Resolver Architecture

At the heart of v0.4.0 is a complete decoupling of prediction generation from trustworthiness evaluation.

TrustLens now uses a Prediction Resolver Architecture that:

  • Automatically detects supported ML frameworks
  • Resolves predictions into a standardized internal contract
  • Preserves framework-specific metadata for auditing
  • Enables future backend expansion without modifying core analysis logic

This lays the foundation for broader ecosystem support while keeping the analysis engine framework-agnostic.


🌟 Highlights

✅ Native XGBoost Support

TrustLens now supports:

  • XGBClassifier
  • raw xgboost.Booster objects

Features include:

  • automatic DMatrix handling
  • probability normalization
  • multiclass support
  • objective-aware task blocking (reg:*, rank:*)

Install optionally:

pip install "trustlens[xgboost]"

✅ Manual Prediction Pipelines (model=None)

TrustLens can now audit external inference pipelines and unsupported frameworks using:

analyze(
    model=None,
    y_pred=predictions,
    y_prob=probabilities,
)

This enables:

  • servability audits
  • external model validation
  • offline prediction evaluation
  • framework-independent trust analysis

✅ Scientifically Correct Multiclass Calibration

Fixed a significant calibration issue affecting multiclass classification.

TrustLens now correctly computes the Multiclass Brier Score using class-wise mean squared error, instead of incorrectly assuming binary probabilities.

This improves the scientific reliability of calibration metrics for complex classification systems.


✅ Audit Provenance & Metadata

Every TrustReport now includes backend provenance:

  • framework detection
  • resolver metadata
  • framework versions
  • manual override tracking
  • degraded analysis transparency

This improves reproducibility, experiment tracking, and deployment auditing.


✅ Stability & Hardening

v0.4.0 includes substantial production hardening:

  • NaN/Inf validation
  • probability range enforcement
  • EPS-based numerical tolerance
  • automatic probability clipping
  • robust override handling
  • graceful degraded-mode execution

When probabilistic outputs are unavailable, TrustLens now explicitly records:

{
  "degraded_mode": true,
  "missing_components": [...]
}

for full transparency.


📦 Unified Export Artifacts

Trust reports are now easier to persist and consume.

report.save("report.json")

generates a single, self-contained artifact containing:

  • results
  • metadata
  • trust score
  • backend provenance

Perfect for:

  • CI/CD model gating
  • experiment tracking
  • ML observability
  • deployment audits

🛡️ Compatibility & Migration

Zero Breaking Changes

Existing scikit-learn workflows continue to work unchanged.

No migration is required for current users.

Optional XGBoost Dependency

XGBoost remains fully optional.

If unused, TrustLens will not import or require it.


📈 Release Quality

v0.4.0 ships with:

  • 263 passing tests
  • characterization parity testing
  • backend stress testing
  • packaging validation
  • production-like smoke testing
  • ~75% test coverage

📚 Documentation

  • Full Changelog → CHANGELOG.md
  • Architecture → docs/architecture.md
  • Backend Contract → docs/internal/prediction_contract.md

Thank you to everyone following and contributing to TrustLens 🚀

This release establishes the foundation for future backend support across the broader ML ecosystem.