How rachit-jain-24/loan-status-approval-prediction-gui-model works
Project Type & Purpose
• This is a single-service, full-stack web application built with Streamlit.
• Purpose: Collect user financial inputs via a browser UI, pass them through a trained machine-learning (Logistic Regression) pipeline, and return an instant “approved” or “denied” prediction.
File Structure
• Top level:
• app.py – Entry point for the Streamlit web server and UI.
• Loan Status Prediction_GUI.ipynb – Jupyter notebook for model exploration/training.
• loan_approval_dataset.csv, loan_prediction_dataset.csv – Raw data used during experimentation/training.
• loan_status_predict/ – Python package housing preprocessing and model-loading code (presumably modules like preprocessor.py, model.py).
• No external databases—model artifacts are deployed locally (via Joblib).
Main Components & Their Responsibilities
a. Client (Browser)
– Renders Streamlit UI, collects input fields (income, credit score, employment, etc.).
b. Streamlit Server (app.py)
– Hosts UI, routes user inputs to the prediction pipeline, displays results.
c. Prediction Engine (loan_status_predict package)
– Preprocessing module: applies scaling, encoding, feature selection (via Pandas & NumPy).
– Model loader module: loads the serialized Logistic Regression model (Joblib).
– Predictor: runs model.predict() and returns classification.
d. Model Artifact (Joblib file)
– Serialized ML model with tuned hyperparameters.
e. (Optional) Data & Training Pipeline
– Jupyter notebook + CSV files used for retraining or batch updates—but not in the live request path.
Relationships & Data Flow
1) User submits form in Browser → HTTP request to Streamlit Server.
2) Streamlit Server invokes Preprocessor with raw inputs.
3) Preprocessor returns a transformed feature vector → fed into Model Loader.
4) Model Loader passes features to the Logistic Regression model → outputs prediction.
5) Streamlit Server returns result to Browser UI.
Architectural Patterns & Design Principles
• Separation of Concerns: UI (Streamlit) vs Business Logic (prediction package) vs Data Artifacts.
• Modular Code Organization: loan_status_predict isolates preprocessing & model logic for testability and maintainability.
• Stateless Service: Each request is self-contained; no session state or database dependencies in production.
Technologies & Frameworks
• Frontend/UI: Streamlit
• Backend/Logic: Python modules (app.py, loan_status_predict)
• Data Processing: Pandas, NumPy
• Machine Learning: Scikit-Learn Logistic Regression, Joblib
• Experimentation: Jupyter Notebook
[Browser UI], [Streamlit Server], [Preprocessing Module], [Model Loader & Predictor], [Model Artifact], [Raw Data/Notebook (optional)].
• Annotations for key frameworks (Streamlit, Pandas, Scikit-Learn, Joblib).