This project presents a machine-learning-based web application for estimating whether a credit card application is likely to be approved. The application is built with Python and Streamlit, and it provides an interactive form for entering applicant information, generating a prediction from a pre-trained machine-learning pipeline, and exporting the result as a PDF report.
The goal of the project is to demonstrate how predictive modeling can be integrated into a user-friendly application for decision support. Although the solution is designed for demonstration and educational purposes, it reflects the typical workflow used in real-world credit risk assessment systems.
Demo Link : https://credit-card-approval-project-s499bdg5brngduypqc4gkq.streamlit.app
The application helps users:
- enter applicant-related information through a simple web interface
- receive a prediction probability for approval
- view a clear decision outcome based on a predefined threshold
- download a PDF summary of the submitted information and prediction result
- Interactive Streamlit web interface
- Pre-trained scikit-learn pipeline loaded from a serialized model file
- Automatic feature alignment to match the training schema
- Approval probability scoring with a binary decision output
- PDF report generation using ReportLab
- Clean and user-friendly presentation for demonstration purposes
- Python 3.11
- Streamlit for the frontend/web interface
- pandas for structured data handling
- scikit-learn for the trained machine-learning pipeline
- joblib for loading the serialized model
- ReportLab for PDF generation
- xgboost as part of the trained model dependencies
The repository contains the following main files:
- credit_card_app.py — the main Streamlit application that loads the model, collects form input, runs prediction, and generates the PDF report
- credit_card_pipeline.pkl — the serialized machine-learning pipeline used for prediction
- requirements.txt — Python package dependencies required to run the app
- Credit_Card_approval.ipynb — notebook version of the project workflow and analysis
- The user opens the app in a browser.
- The application loads a pre-trained pipeline from the model file.
- The user fills in the applicant form with fields such as gender, income, education, housing, occupation, and employment details.
- The entered values are transformed into the feature structure expected by the trained pipeline.
- The model returns a probability score representing the likelihood of approval.
- A decision is assigned based on a threshold of 60% probability.
- The result is displayed in the interface and can be exported as a PDF document.
The prediction logic relies on a pre-trained machine-learning pipeline stored in credit_card_pipeline.pkl. The pipeline includes preprocessing and the final classifier, allowing the application to handle the required input fields consistently.
Some values entered by the user are converted into the representation expected by the model. For example:
- age and years employed are converted into day-based values used during training
- the number of family members is derived from the number of children
- a binary occupation flag is created depending on whether the occupation is marked as unknown
Follow the steps below to run the project locally.
git clone <repository-url>
cd Credit-Card-Approval-Projectpython -m venv .venvOn Windows:
.venv\Scripts\activateOn macOS/Linux:
source .venv/bin/activatepip install -r requirements.txtstreamlit run credit_card_app.pyOnce the app is running, it will open in the browser and you can begin entering applicant details.
- Launch the application using Streamlit.
- Fill in the form fields with the applicant information.
- Click the prediction button.
- Review the approval probability and decision.
- Download the generated PDF report if needed.
The app generates a downloadable PDF file summarizing:
- the final decision
- the approval probability
- the applicant details submitted in the form
The report is produced using ReportLab and is formatted for easy reading and sharing.
This project is intended as a demonstration of an ML-powered application and should not be treated as a real-world credit decision system without proper validation, compliance review, and domain-specific testing.
Some limitations include:
- the model is pre-trained and fixed for the current demonstration
- the decision threshold is manually set and may not represent real business policy
- the app uses a simplified input schema and does not include all possible financial or regulatory variables
- real-world lending systems require rigorous monitoring, fairness assessment, and risk governance
Possible improvements for future versions include:
- adding explainability features such as SHAP or feature importance charts
- improving the UI with a more polished dashboard experience
- adding input validation and better error handling
- storing previous predictions for review
- adding automated tests for the prediction flow
This project combines machine learning, web development, and report generation into a single interactive application. It demonstrates how a trained classification model can be wrapped in a user-friendly interface and used to support preliminary decision-making in a practical and understandable way.