Skip to content
All projects
Machine Learning

Loan Approval ML Pipeline

I built an end-to-end tabular ML pipeline: preprocessing, exploratory analysis, a five-model comparison, model selection, serialisation and a Streamlit app that serves the saved model.

Pipeline06 stages
  1. 01
    Applicant CSV
  2. 02
    ColumnTransformer encode + scale
  3. 03
    Five-model comparison
  4. 04
    Logistic Regression selected
  5. 05
    joblib model.pkl
  6. 06
    Streamlit prediction app
Schematic, not a screenshot

01Problem

Loan applications get reviewed manually and inconsistently, so the useful baseline question is how much of the approval decision a small tabular model can recover from applicant attributes alone.

02Implementation

  • Wrapped preprocessing in a scikit-learn ColumnTransformer, one-hot encoding categorical columns and standard-scaling numeric ones, inside a Pipeline so the same transforms apply at inference.
  • Compared Logistic Regression, SVM, Random Forest, Decision Tree and KNN on accuracy and F1.
  • Selected Logistic Regression and serialised the fitted pipeline to model.pkl with joblib.
  • Explored distributions, correlations and class balance in a notebook, which showed credit history dominating approval rates.
  • Built a Streamlit app that loads the saved pipeline and predicts from user input.

03Models

Logistic Regression
Selected as the final model and serialised into the served pipeline.
SVM, Random Forest, Decision Tree, KNN
Compared against the baseline on accuracy and F1 during model selection.

04Input data

Tabular loan application records covering gender, marital status, dependents, income, loan amount and credit history, committed to the repository.

05Results

Runs end to end from raw CSV to a served model: the comparison selects Logistic Regression, the fitted pipeline is saved, and the Streamlit app predicts from it.

The repository reports Logistic Regression as the strongest model on accuracy and F1 but does not publish the numeric scores, so none are quoted here.

06Stack

PythonScikit-learnpandasNumPyStreamlitjoblibJupyter

07Visuals

Screenshot or architecture diagram to be added