|
10 | 10 |
|
11 | 11 | @dataclass |
12 | 12 | class PSProcessorConfig: |
| 13 | + """ |
| 14 | + Configuration for propensity score processing. |
| 15 | +
|
| 16 | + This dataclass holds the configuration parameters used by PSProcessor |
| 17 | + for propensity score calibration, clipping, and validation. |
| 18 | +
|
| 19 | + Parameters |
| 20 | + ---------- |
| 21 | + clipping_threshold : float, default=1e-2 |
| 22 | + Minimum and maximum bound for propensity scores after clipping. |
| 23 | + Must be between 0 and 0.5. |
| 24 | +
|
| 25 | + extreme_threshold : float, default=1e-12 |
| 26 | + Threshold below which propensity scores are considered extreme. |
| 27 | + Propensity scores are clipped based on this value when scores are too close to 0 or 1 |
| 28 | + to avoid numerical instability. |
| 29 | + Must be between 0 and 0.5. |
| 30 | +
|
| 31 | + calibration_method : {'isotonic', None}, optional |
| 32 | + If provided, applies the specified calibration method to |
| 33 | + the propensity scores before clipping. Currently supports: |
| 34 | + - 'isotonic': Isotonic regression calibration |
| 35 | + - None: No calibration applied |
| 36 | +
|
| 37 | + cv_calibration : bool, default=False |
| 38 | + Whether to use cross-validation for calibration. |
| 39 | + Only applies if a calibration method is specified. |
| 40 | + Requires calibration_method to be set. |
| 41 | +
|
| 42 | + Examples |
| 43 | + -------- |
| 44 | + >>> from doubleml.utils import PSProcessorConfig, PSProcessor |
| 45 | + >>> config = PSProcessorConfig( |
| 46 | + ... clipping_threshold=0.05, |
| 47 | + ... calibration_method='isotonic', |
| 48 | + ... cv_calibration=True |
| 49 | + ... ) |
| 50 | + >>> processor = PSProcessor.from_config(config) |
| 51 | + """ |
13 | 52 | clipping_threshold: float = 1e-2 |
14 | 53 | extreme_threshold: float = 1e-12 |
15 | 54 | calibration_method: Optional[str] = None |
|
0 commit comments