Downloads · 30 days
0
Chakri5658/Chakri-loanmate-model
Chakri-loanmate-model is a machine learning model from Chakri5658. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Jun 1, 2025
Repo size
10.2 MB
Likes
0
Public
Click a slice to open those files.
.pkl10.2 MB · 100%
From the Hugging Face model README

This document provides a more in-depth look at the LoanMate loan approval prediction model.
The LoanMate model utilizes an ensemble learning approach to achieve robust and accurate predictions. It combines the strengths of several individual machine learning algorithms. The core idea is that by aggregating the predictions of multiple models, the overall performance can be improved, and the risk of relying on a single model's potential weaknesses is mitigated.
The ensemble typically includes the following types of models:
Each of these models is trained on the preprocessed data, and their predictions are combined (e.g., through voting or averaging probabilities) to produce the final loan approval decision and probability score.

The model was trained and evaluated on a combination of loan application datasets to ensure generalization across different applicant profiles and loan scenarios.
Other internal or proprietary datasets might have also been used during the development of the model to enhance its robustness.
Consistent and thorough data preprocessing is crucial for the performance of any machine learning model. The following steps are applied to the raw input data before it's fed to the models:
Handling Missing Values:
**Feature Engineering (Derived Features):
DebtToIncomeRatio: Calculated as (Existing Debt / Annual Income) * 100.LoanToIncomeRatio: Calculated as (Loan Amount / Annual Income) * 100.IncomeToDebtRatio: Calculated as Annual Income / (Existing Debt + 1) (1 is added to avoid division by zero).Encoding Categorical Features:
Scaling Numerical Features:
These preprocessing steps are encapsulated within a ColumnTransformer and Pipeline from scikit-learn. This ensures that the same transformations are applied consistently during training, evaluation, and prediction.
The build_master_model function in loan_master_model.py is responsible for orchestrating the training process for different dataset types (like 'hugging' and 'loan_approval'). For each dataset type, it defines the specific preprocessor and trains the ensemble model.
The final trained model, which includes the preprocessors and the ensemble models for each dataset type, is saved as a single loan_master_model.pkl file using joblib. joblib is preferred over pickle for saving scikit-learn models as it's more efficient with large NumPy arrays.
When a new loan application is submitted via the Gradio interface:
predict_loan_approval function is called.dataset_type (which is 'hugging' for the Space).This detailed process ensures that predictions are made consistently with how the model was trained.