P2P Lending Risk Prediction Model

This model is a Balanced Logistic Regression classifier designed to predict the risk of a loan being 'Charged Off' in a Peer-to-Peer (P2P) lending scenario.

Model Description

The model predicts a binary outcome: whether a loan will be 'Fully Paid' (0) or 'Charged Off' (1). It was trained on a subset of the LendingClub dataset.

Intended Uses and Limitations

Intended Uses

This model is intended to assist in assessing the risk associated with P2P loans. It can be used by lenders to make informed decisions about granting loans or by investors to evaluate potential investment risks.

Limitations

  • Dataset Specificity: The model was trained exclusively on the LendingClub dataset. Its performance may vary significantly on data from other lending platforms or different economic conditions.
  • Feature Set: Only a limited set of features (loan amount, annual income, debt-to-income ratio, interest rate, and grade) were used. Other crucial factors not included could influence actual loan outcomes.
  • Class Imbalance: Although class_weight='balanced' was used during training, 'Charged Off' cases are inherently less frequent. The model's ability to perfectly predict all 'Charged Off' instances is limited.
  • Not Financial Advice: This model is for illustrative and educational purposes only and should not be used as the sole basis for financial decisions.

Training Data

The model was trained on a dataset derived from LendingClub, consisting of 5,349 loan entries with 5 features. The target variable risk (0 for 'Fully Paid', 1 for 'Charged Off') exhibited an imbalance, with 'Fully Paid' being the majority class.

Evaluation Results

The model was evaluated on a test set of 1070 rows. Key metrics for the Balanced Logistic Regression model (with a default threshold of 0.5) are as follows:

  • Accuracy: 0.7324
  • Precision: 0.3223
  • Recall: 0.6834
  • F1 Score: 0.4380
  • ROC-AUC: 0.7324

Note: Due to the nature of risk prediction where identifying actual 'Charged Off' loans is critical, Recall is often a prioritized metric. This model achieves a Recall of 0.6834 for the 'Charged Off' class at the default 0.5 threshold, which can be further tuned as demonstrated in the notebook.

How to Use

To load the model and make predictions, you can use the following Python code snippet:

import joblib
import pandas as pd

# Load the saved model
model = joblib.load("p2p_lending_risk_model.joblib")

# Example input data
input_data = pd.DataFrame([{
    "loan_amnt":  15000.0,
    "annual_inc": 75000.0,
    "dti":        20.0,
    "int_rate":   14.5,
    "grade":      "C",
}])

# Make a prediction
prediction = model.predict(input_data)[0]
probability = model.predict_proba(input_data)[0, 1]

risk_label = "Charged Off" if prediction == 1 else "Fully Paid"

print(f"Predicted Risk Status: {risk_label}")
print(f"Probability of Charged Off: {probability:.4f}")
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support