Skip to content

Latest commit

Β 

History

History
117 lines (84 loc) Β· 3.02 KB

File metadata and controls

117 lines (84 loc) Β· 3.02 KB

πŸ“Š Bankruptcy Prediction System Using Machine Learning

Bankruptcy Prediction System image

This project is a full machine learning pipeline for predicting company bankruptcy based on financial and operational features. It uses multiple classification algorithms and is deployed via Gradio and Hugging Face Spaces.

πŸš€ Live Demo

πŸ‘‰ Try it on Hugging Face Spaces


🧠 Models Implemented

  • Logistic Regression
  • Random Forest
  • XGBoost
  • Multilayer Perceptron (MLP)

πŸ”§ Features

  • Data Preprocessing
    • Feature selection using SelectKBest with ANOVA F-test
    • Balancing with SMOTE
  • Model Training and Evaluation
    • Accuracy, Precision, Recall, F1-score, ROC AUC
    • Confusion Matrix visualization
  • Hyperparameter Tuning
  • Interactive Prediction UI via Gradio
  • Cloud Deployment using Hugging Face Spaces and AWS

πŸ“ Project Structure

bankruptcy_prediction/
β”œβ”€β”€ bankruptcy_model.py # Main ML pipeline script
β”œβ”€β”€ app.py # Gradio app for UI
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ model.pkl # Trained model
└── README.md # Project documentation

πŸ–₯️ Technologies Used

  • Python
  • scikit-learn
  • xgboost
  • imbalanced-learn
  • Gradio
  • Google Colab
  • AWS (S3 & SageMaker)
  • Hugging Face Spaces

πŸ“Š Dataset

  • Financial dataset of companies with binary labels for bankruptcy.
  • Feature selection reduced dimensions from 96 to 20 using statistical relevance.

πŸ“‰ Results

Model Accuracy Precision Recall F1 Score ROC AUC
Logistic Regression 0.87 0.88 0.85 0.86 0.92
Random Forest 0.91 0.92 0.90 0.91 0.95
XGBoost 0.93 0.94 0.92 0.93 0.97
MLP Classifier 0.89 0.90 0.87 0.88 0.94

πŸ“¦ Installation

Clone the repository:

git clone https://github.com/AdMub/bankruptcy-prediction.git
cd bankruptcy-prediction

Install the dependencies:

pip install -r requirements.txt

Run the app locally:

python app.py

🌐 Deployment

  • Gradio App: Built for local or web-based UI.
  • Hugging Face: Easily hosted with app.py and requirements.txt.
  • AWS S3/SageMaker: Model files and training logs available for cloud workflows.

πŸ€” Future Improvements

  • Add more interpretability (e.g., SHAP or LIME)
  • Improve feature engineering
  • Incorporate financial ratios or temporal data
  • Deploy with containerized solutions (Docker + AWS ECS)

πŸ‘¨β€πŸ’» Author

AdMub

  • πŸ“š University of the People & University of Ibadan
  • πŸ”— LinkedIn | Twitter

πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for more details.