{"id":19492722,"url":"https://github.com/flobz/bankruptcy-prediction","last_synced_at":"2026-06-19T14:32:39.760Z","repository":{"id":104295241,"uuid":"328455299","full_name":"flobz/Bankruptcy-prediction","owner":"flobz","description":"Bankruptcy prediction","archived":false,"fork":false,"pushed_at":"2021-01-10T22:33:28.000Z","size":9502,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T14:35:53.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flobz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-10T18:49:32.000Z","updated_at":"2021-01-10T22:33:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c4b0610-aba9-4506-a933-73444c37a16c","html_url":"https://github.com/flobz/Bankruptcy-prediction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flobz/Bankruptcy-prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flobz%2FBankruptcy-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flobz%2FBankruptcy-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flobz%2FBankruptcy-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flobz%2FBankruptcy-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flobz","download_url":"https://codeload.github.com/flobz/Bankruptcy-prediction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flobz%2FBankruptcy-prediction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34536276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T21:22:41.253Z","updated_at":"2026-06-19T14:32:34.748Z","avatar_url":"https://github.com/flobz.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Bankruptcy prediction\n\nI use a dataset that can be found [here](https://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data#). \n\nThe goal is to predict if a company will go bankrupt in the next 5 years.\nYou can see my work [here](https://github.com/flobz/Bankruptcy-prediction/blob/master/bankruptcy_prediction.ipynb)\n\n# Context\n\nThis work was done for an exam, goals were:\n- Understand a dataset\n- Show interesting data with table and graph\n- Use the best machine learning algorithm\n- Optimize the algorithm\n- Predict result\n- Create an api to work with the model\n\n\n\n# API\n\n## Usage\nYou can test the model with the API that I developed. To use it you will need to install the requirement:\n\n```pip install -r requirements.txt```\n\nThen start the api:\n\n```python3 api.py```\n\nThen you need to create a request with data in json format like this:\n```json\n{ \"nbyear\": \"a number between 1 and 5\",\n  \"data\": [\"64 financial data of the company\"]\n}\n```\n\nTo create the \"data\" field see all attributes you need to specify [here](https://github.com/flobz/Bankruptcy-prediction/blob/master/data/attribute.txt).\nYou need to use the same order.\n\n\n## Example \n\n```commandline\ncurl -X POST -H \"Content-Type: application/json\" http://127.0.0.1:5000/is_bankrupt -d'{\"nbyear\": 1, \"data\": [0.20055, 0.37951, 0.39641, 2.0472, 32.351, 0.38825, 0.24976, 1.3305, 1.1389, 0.50494, 0.24976, 0.6598, 0.1666, 0.24976, 497.42, 0.73378, 2.6349, 0.24976, 0.14942, 43.37, 1.2479, 0.21402, 0.11998, 0.47706, 0.50494, 0.60411, 1.4582, 1.7615, 5.9443, 0.11788, 0.14942, 94.14, 3.8772, 0.56393, 0.21402, 1.741, 593.27, 0.50591, 0.12804, 0.66295, 0.051402, 0.12804, 114.42, 71.05, 1.0097, 1.5225, 49.394, 0.1853, 0.11085, 2.042, 0.37854, 0.25792, 2.2437, 2.248, 348690.0, 0.12196, 0.39718, 0.87804, 0.001924, 8.416, 5.1372, 82.658, 4.4158, 7.4277]}'\n{\n  \"Bankrupt\": false, \n  \"Information\": \"The company will not go bankrupt in 1 year.\"\n}\n```\n\n```commandline\ncurl -X POST -H \"Content-Type: application/json\" http://127.0.0.1:5000/is_bankrupt -d'{\"nbyear\": 3, \"data\": [0.080622, 1.0208, 0.13118, 1.1542, -9.2273, -0.24848, 0.080622, -0.02034, 2.3527, -0.020763, 0.082926, 0.094766, 0.037078, 0.080622, 4271.1, 0.085457, 0.97961, 0.080622, 0.034267, 28.227, 1.6757, 0.082926, 0.034267, -0.16781, -0.16791, 0.085457, 35.993, 7.2508, 3.6773, 0.43301, 0.034805, 136.8, 2.6708, 2.2259, 0.082705, 2.3553, 58.736, -0.007143, 0.035153, 0.010993, 0.38002, 0.035247, 150.88, 122.66, 0.44311, 0.22486, 29.256, 0.076313, 0.032436, 0.9619, 0.85075, 0.37479, -1.1477, -0.39484, 624.0, 0.035204, -3.883, 0.96474, -0.65597, 12.931, 2.9758, 131.98, 2.7655, 130.05, 1.0]}'\n{\n  \"Bankrupt\": true, \n  \"Information\": \"The company will probably go bankrupt in 3 year.\"\n}\n```\n\n## Conclusion\n\nWith this dataset we have a very good accuracy. I had only 21 false negative and no false positive on 1700 row.\nThe XGbost algorithm worked very well.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflobz%2Fbankruptcy-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflobz%2Fbankruptcy-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflobz%2Fbankruptcy-prediction/lists"}