Best Practices and Detailed Explanations¶
Data Preprocessing Pipeline¶
Consistency: Saving and reusing pipelines ensures that the same data transformations are applied consistently across training and new data.
Flow Control: Decide between automatic and manual flow based on the complexity of your data transformations.
Serialization: Use dill for serializing the pipeline, which can handle complex objects like custom functions and classes.
WoE Analysis and Binning¶
Safety Checks: Use parameters like safety and threshold to prevent creating features with too many unique values or inappropriate data types.
safety (bool, default True): If True, the method performs a safety check on the feature before processing, designed to prevent hardware crashes due to memory shortages when dealing with high-cardinality features.
threshold (int, default 300): Specifies the maximum number of unique values allowed in a discrete feature when safety is True. If the feature exceeds this threshold, it will not be processed unless you either increase the threshold or set safety=False.
Handling High Cardinality: High-cardinality features can cause performance issues. The safety parameter helps prevent such issues by limiting the number of unique values.
Manual vs. Automatic Binning: Choose manual binning for more control, or use automatic suggestions provided by the library.
Outlier Handling: Use binning validation reports to adjust bins as necessary, ensuring that data falls within defined ranges.
Data Transformation with WoeBinning¶
Selective Transformation: Modify WoE_dict to include only the features you want to transform.
Production Mode:
Development Environment: Set production=False to raise errors when outliers are encountered, allowing you to identify and fix data issues.
Production Environment: Set production=True to handle outliers gracefully by removing affected rows, ensuring uninterrupted processing.
Credit Score Scaling¶
Customization: Adjust scaling constants and parameters to fit your specific use case or regulatory requirements.
Scorecard Generation: Use the generated scorecard to understand how scores are computed and for transparency in decision-making.
Monitoring: Regularly test and monitor the scorecard’s performance on new data to ensure it remains predictive.