You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v0.1.4.post2: Monotonic Constraints Support
- Add comprehensive monotonic constraints support across all binning methods
- Tree method: Native scikit-learn monotonic constraints
- KBins/FAISS methods: Isotonic regression post-processing
- Add extensive test coverage for all constraint scenarios
- Update documentation and examples
- Fix FAISS API compatibility and type checking issues
- Add comprehensive example (examples/fastwoe_monotonic.py)
FastWoe supports **monotonic constraints** for numerical features, ensuring that WOE values follow business logic requirements. This is particularly important for credit scoring and regulatory compliance.
386
+
387
+
### When to Use Monotonic Constraints
388
+
389
+
- **Credit Scoring**: Higher income should lead to lower risk
390
+
- **Age-based Risk**: Higher age might lead to higher risk (depending on context)
391
+
- **Credit Score**: Higher credit scores should lead to lower risk
392
+
- **Regulatory Compliance**: When business rules require monotonic relationships
393
+
394
+
### Example Usage
395
+
396
+
```python
397
+
import pandas as pd
398
+
import numpy as np
399
+
from fastwoe import FastWoe
400
+
401
+
# Create sample credit scoring data
402
+
np.random.seed(42)
403
+
n_samples = 1000
404
+
405
+
# Income: higher income -> lower risk (decreasing constraint)
406
+
income = np.random.lognormal(mean=10, sigma=0.5, size=n_samples)
0 commit comments