- Project Motivation and Description
- Proposed solution
- Dataset
- Technologies Used
- Installation
- Makefile Commands
- Usage
- Accessing the WebApp
In today's dynamic business environment, anticipating financial risks is crucial. This project aims to develop a predictive model for company bankruptcy using advanced machine learning algorithms and financial data analysis. By identifying early signs of financial distress, stakeholders can make informed decisions to prevent bankruptcy, minimizing financial losses.
We explore various machine learning models to predict company bankruptcy, focusing on improving accuracy. The dataset, from Polish companies, spans 2000-2013 and includes 64 features related to profitability, liquidity, solvency, and operational efficiency. Our project will explore and compare the usage of different machine learning models to predict company bankruptcy. We will evaluate the different models using various metrics, and improve their accuracy for better model performance.
We employ multiple predictive models, including logistic regression, k-nearest neighbors, and decision trees, with logistic regression as the benchmark. Ensemble methods like bagging, boosting, and random forests will enhance predictive capabilities, providing a comprehensive understanding of financial risk.
Source: Polish Companies Bankruptcy Data
Features Include:
- Net profit / total assets
- Total liabilities / total assets
- Working capital / total assets
- Current assets / short-term liabilities
- And many more financial ratios and metrics.
-
Clone the Repository
git clone https://github.com/ChinSekYi/Bankruptcy-Prediction.git cd Bankruptcy-Prediction
-
Create and activate virtual environment
Using Anaconda:conda create -n dev python=3.11 conda activate dev
Using venv:
python -m venv dev source dev/bin/activate #On macOS/Linux source dev/bin/activate #On Windows
-
Install Project Dependencies
make install
make install
: Upgradespip
and installs the dependencies listed inrequirements.txt
.make test
: Runs tests usingpytest
ontest.py
. (Note: You can also run tests on notebooks by uncommenting the#--nbval
line if needed.)make format
: Formats all Python files usingisort
andblack
.make run
: Runs themain.py
script.make lint
: Lints the code withpylint
, excluding certain message types (R and C) for the specified directories and files.make all
: Executesinstall
,format
, andlint
commands in sequence.
Open the following 3 notebooks:
- For Exploratory Data Analysis, Data Cleaning and Data Preprocessing:
jupyter notebook notebook/EDA.ipynb
- For Feature Selection:
jupyter notebook notebook/FEATURE_SELECTION.ipynb
- For Model Training and Evaluation:
jupyter notebook notebook/MODEL_TRAINING.ipynb
-
Run Flask app using CLI
cd Bankruptcy-Prediction python3 app.py
Then, access the application by clicking on one of the links below:
-
Access WebApp deployed through Microsoft Azure (Not active for now to avoid billing)