-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstability_analysis_lending_club.py
More file actions
33 lines (24 loc) · 1.28 KB
/
Copy pathstability_analysis_lending_club.py
File metadata and controls
33 lines (24 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pandas as pd
import numpy as np
import pickle
import os
def stability_analysis_lending_club(processed_data_path, model_path):
print("Starting stability analysis for LendingClub dataset...")
if not os.path.exists(processed_data_path):
print(f"Error: Preprocessed data not found at {processed_data_path}. Skipping stability analysis for LendingClub.")
return
if not os.path.exists(model_path):
print(f"Error: Trained model not found at {model_path}. Skipping stability analysis for LendingClub.")
return
df_processed = pd.read_csv(processed_data_path)
with open(model_path, 'rb') as f:
model = pickle.load(f)
# Placeholder for stability analysis
with open("explainable-credit-scoring/stability_analysis/lending_club_stability_results.txt", "w") as f:
f.write("LendingClub Stability Analysis Results\n")
f.write("Placeholder for actual stability metrics.")
print("Stability analysis complete for LendingClub dataset.")
if __name__ == "__main__":
processed_data_path = "explainable-credit-scoring/data_preprocessing/lending_club_processed_data_fold0.csv"
model_path = "explainable-credit-scoring/model_training/lending_club_model.pkl"
stability_analysis_lending_club(processed_data_path, model_path)