@@ -97,9 +97,9 @@ We can also visualize the score distribution between the events of interest.
9797from xbooster import explainer
9898
9999explainer.plot_score_distribution(
100- y_test,
100+ y_test,
101101 credit_scores,
102- num_bins = 30 ,
102+ num_bins = 30 ,
103103 figsize = (8 , 3 ),
104104 dpi = 100
105105)
@@ -156,7 +156,7 @@ print(f"Rule reduction: {len(xgb_scorecard_with_points)} → {len(interval_score
156156print (" \n Interval format:" )
157157print (interval_scorecard[[' Feature' , ' Bin' , ' Points' , ' WOE' ]].head())
158158
159- # Add Points at Even Odds/Points to Double the Odds (PEO/PDO)
159+ # Add Points at Even Odds/Points to Double the Odds (PEO/PDO)
160160peo_pdo_scorecard = scorecard_constructor.create_points_peo_pdo(peo = 600 , pdo = 50 )
161161print (" \n PEO/PDO Points:" )
162162print (peo_pdo_scorecard[[' Feature' , ' Bin' , ' Points_PEO_PDO' ]].head())
@@ -194,8 +194,8 @@ target = "Loan_Status"
194194
195195# Initialize preprocessor
196196preprocessor = DataPreprocessor(
197- numerical_features,
198- categorical_features,
197+ numerical_features,
198+ categorical_features,
199199 target
200200)
201201
@@ -204,7 +204,7 @@ X, y = preprocessor.fit_transform(dataset)
204204
205205# Get one-hot encoded feature names
206206features_ohe = [
207- col for col in X.columns
207+ col for col in X.columns
208208 if col not in numerical_features
209209]
210210
@@ -281,9 +281,9 @@ woe_scores = constructor.predict_score(X, method="woe")
281281
282282# Now create points for the scorecard
283283scorecard_with_points = constructor.create_points(
284- pdo = 50 ,
285- target_points = 600 ,
286- target_odds = 19 ,
284+ pdo = 50 ,
285+ target_points = 600 ,
286+ target_odds = 19 ,
287287 precision_points = 0
288288)
289289
@@ -529,4 +529,4 @@ For code contributions, please open a pull request.
529529For a changelog, see [ CHANGELOG] ( CHANGELOG.md ) .
530530
531531## License 📄
532- This project is licensed under the MIT License - see the LICENSE file for details.
532+ This project is licensed under the MIT License - see the LICENSE file for details.
0 commit comments