diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..94f4cbf --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,39 @@ +name: Deploy to Render + +on: + push: + branches: + - main # Adjust this branch as needed + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 # Replace with your Python version + + - name: Install dependencies + run: pip install -r requirements.txt # Replace with your requirements file + + - name: Build Docker image + run: | + docker build -t company_bankruptcy_predictor:latest . + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker tag company_bankruptcy_predictor:latest sayam2801/company_bankruptcy_predictor:latest + docker push sayam2801/company_bankruptcy_predictor:latest + + - name: Deploy to Render + run: | + curl -X POST -H "Authorization: Bearer ${{ secrets.RENDER_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data '{ + "image": "company_bankruptcy_predictor:latest", + "serviceId": "srv-ckl722rj89us73coe160" # Replace with your Render service ID + }' \ + https://api.render.com/v1/deploys \ No newline at end of file diff --git a/Company Bankruptcy Prediction.ipynb b/Company Bankruptcy Prediction.ipynb index ebe8bf0..a6b8ff2 100644 --- a/Company Bankruptcy Prediction.ipynb +++ b/Company Bankruptcy Prediction.ipynb @@ -5276,7 +5276,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 169, "id": "261d1595", "metadata": {}, "outputs": [ @@ -5321,6 +5321,15 @@ " \n", " \n", " 1\n", + " RandomizedSearchCV(cv=5, estimator=RandomFores...\n", + " 0.977273\n", + " 0.977445\n", + " 0.977387\n", + " 0.977273\n", + " 0.977387\n", + " \n", + " \n", + " 2\n", " (ExtraTreeClassifier(random_state=191144010), ...\n", " 0.976010\n", " 0.976301\n", @@ -5329,7 +5338,7 @@ " 0.976151\n", " \n", " \n", - " 2\n", + " 3\n", " VotingClassifier(estimators=[('ET', ExtraTrees...\n", " 0.975505\n", " 0.975772\n", @@ -5338,7 +5347,25 @@ " 0.975641\n", " \n", " \n", - " 3\n", + " 4\n", + " RandomizedSearchCV(cv=5, estimator=HistGradien...\n", + " 0.975000\n", + " 0.975341\n", + " 0.975150\n", + " 0.974999\n", + " 0.975150\n", + " \n", + " \n", + " 5\n", + " RandomizedSearchCV(cv=5,\\n e...\n", + " 0.974242\n", + " 0.974454\n", + " 0.974366\n", + " 0.974242\n", + " 0.974366\n", + " \n", + " \n", + " 6\n", " <catboost.core.CatBoostClassifier object at 0x...\n", " 0.974242\n", " 0.974521\n", @@ -5347,7 +5374,7 @@ " 0.974381\n", " \n", " \n", - " 4\n", + " 7\n", " <catboost.core.CatBoostClassifier object at 0x...\n", " 0.974242\n", " 0.974521\n", @@ -5356,7 +5383,16 @@ " 0.974381\n", " \n", " \n", - " 5\n", + " 8\n", + " RandomizedSearchCV(cv=5, estimator=KNeighborsC...\n", + " 0.973990\n", + " 0.974357\n", + " 0.974145\n", + " 0.973989\n", + " 0.974145\n", + " \n", + " \n", + " 9\n", " (DecisionTreeClassifier(max_features='auto', r...\n", " 0.972980\n", " 0.973270\n", @@ -5365,7 +5401,7 @@ " 0.973120\n", " \n", " \n", - " 6\n", + " 10\n", " XGBClassifier(base_score=None, booster=None, c...\n", " 0.972475\n", " 0.972841\n", @@ -5374,7 +5410,16 @@ " 0.972630\n", " \n", " \n", - " 7\n", + " 11\n", + " RandomizedSearchCV(estimator=ExtraTreesClassif...\n", + " 0.970202\n", + " 0.970831\n", + " 0.970398\n", + " 0.970198\n", + " 0.970398\n", + " \n", + " \n", + " 12\n", " HistGradientBoostingClassifier()\n", " 0.967677\n", " 0.968028\n", @@ -5383,7 +5428,7 @@ " 0.967829\n", " \n", " \n", - " 8\n", + " 13\n", " MLPClassifier()\n", " 0.967172\n", " 0.967382\n", @@ -5392,7 +5437,16 @@ " 0.967295\n", " \n", " \n", - " 9\n", + " 14\n", + " RandomizedSearchCV(estimator=LGBMClassifier(),...\n", + " 0.967172\n", + " 0.967666\n", + " 0.967348\n", + " 0.967169\n", + " 0.967348\n", + " \n", + " \n", + " 15\n", " LGBMClassifier()\n", " 0.966919\n", " 0.967257\n", @@ -5401,7 +5455,25 @@ " 0.967069\n", " \n", " \n", - " 10\n", + " 16\n", + " RandomizedSearchCV(cv=5, estimator=GradientBoo...\n", + " 0.966667\n", + " 0.966966\n", + " 0.966809\n", + " 0.966666\n", + " 0.966809\n", + " \n", + " \n", + " 17\n", + " RandomizedSearchCV(estimator=BaggingClassifier...\n", + " 0.966162\n", + " 0.966624\n", + " 0.966333\n", + " 0.966159\n", + " 0.966333\n", + " \n", + " \n", + " 18\n", " (DecisionTreeClassifier(random_state=157850700...\n", " 0.964646\n", " 0.964781\n", @@ -5410,7 +5482,7 @@ " 0.964750\n", " \n", " \n", - " 11\n", + " 19\n", " KNeighborsClassifier()\n", " 0.957828\n", " 0.959996\n", @@ -5419,7 +5491,16 @@ " 0.958176\n", " \n", " \n", - " 12\n", + " 20\n", + " RandomizedSearchCV(cv=5, estimator=SVC(),\\n ...\n", + " 0.956061\n", + " 0.956487\n", + " 0.956226\n", + " 0.956058\n", + " 0.956226\n", + " \n", + " \n", + " 21\n", " DecisionTreeClassifier()\n", " 0.953030\n", " 0.953147\n", @@ -5428,7 +5509,16 @@ " 0.953128\n", " \n", " \n", - " 13\n", + " 22\n", + " RandomizedSearchCV(cv=5, estimator=DecisionTre...\n", + " 0.946465\n", + " 0.946581\n", + " 0.946562\n", + " 0.946465\n", + " 0.946562\n", + " \n", + " \n", + " 23\n", " XGBRFClassifier(base_score=None, booster=None,...\n", " 0.944192\n", " 0.944778\n", @@ -5437,7 +5527,7 @@ " 0.944383\n", " \n", " \n", - " 14\n", + " 24\n", " ([DecisionTreeRegressor(criterion='friedman_ms...\n", " 0.942172\n", " 0.942239\n", @@ -5446,7 +5536,7 @@ " 0.942251\n", " \n", " \n", - " 15\n", + " 25\n", " SVC()\n", " 0.941667\n", " 0.942156\n", @@ -5455,7 +5545,16 @@ " 0.941843\n", " \n", " \n", - " 16\n", + " 26\n", + " RandomizedSearchCV(cv=5, estimator=AdaBoostCla...\n", + " 0.929040\n", + " 0.929067\n", + " 0.929099\n", + " 0.929040\n", + " 0.929099\n", + " \n", + " \n", + " 27\n", " (DecisionTreeClassifier(max_depth=1, random_st...\n", " 0.923485\n", " 0.923520\n", @@ -5464,7 +5563,34 @@ " 0.923548\n", " \n", " \n", - " 17\n", + " 28\n", + " RandomizedSearchCV(cv=5, estimator=PassiveAggr...\n", + " 0.906061\n", + " 0.906454\n", + " 0.906222\n", + " 0.906054\n", + " 0.906222\n", + " \n", + " \n", + " 29\n", + " RandomizedSearchCV(cv=5, estimator=LinearSVC()...\n", + " 0.905051\n", + " 0.905497\n", + " 0.905221\n", + " 0.905043\n", + " 0.905221\n", + " \n", + " \n", + " 30\n", + " RandomizedSearchCV(cv=5,\\n e...\n", + " 0.902778\n", + " 0.902843\n", + " 0.902854\n", + " 0.902778\n", + " 0.902854\n", + " \n", + " \n", + " 31\n", " LogisticRegression()\n", " 0.902525\n", " 0.902596\n", @@ -5473,7 +5599,7 @@ " 0.902604\n", " \n", " \n", - " 18\n", + " 32\n", " SGDClassifier()\n", " 0.902273\n", " 0.902376\n", @@ -5482,7 +5608,16 @@ " 0.902363\n", " \n", " \n", - " 19\n", + " 33\n", + " RandomizedSearchCV(cv=5, estimator=LogisticReg...\n", + " 0.902020\n", + " 0.902103\n", + " 0.902103\n", + " 0.902020\n", + " 0.902103\n", + " \n", + " \n", + " 34\n", " LinearSVC()\n", " 0.901263\n", " 0.901328\n", @@ -5491,7 +5626,16 @@ " 0.901338\n", " \n", " \n", - " 20\n", + " 35\n", + " RandomizedSearchCV(cv=5, estimator=SGDClassifi...\n", + " 0.897727\n", + " 0.897891\n", + " 0.897837\n", + " 0.897726\n", + " 0.897837\n", + " \n", + " \n", + " 36\n", " RidgeClassifier()\n", " 0.894697\n", " 0.895429\n", @@ -5500,7 +5644,16 @@ " 0.894913\n", " \n", " \n", - " 21\n", + " 37\n", + " RandomizedSearchCV(cv=5, estimator=RidgeClassi...\n", + " 0.894697\n", + " 0.895429\n", + " 0.894913\n", + " 0.894677\n", + " 0.894913\n", + " \n", + " \n", + " 38\n", " NuSVC()\n", " 0.893434\n", " 0.893436\n", @@ -5509,7 +5662,7 @@ " 0.893410\n", " \n", " \n", - " 22\n", + " 39\n", " GaussianNB()\n", " 0.888131\n", " 0.888185\n", @@ -5518,7 +5671,7 @@ " 0.888201\n", " \n", " \n", - " 23\n", + " 40\n", " BernoulliNB()\n", " 0.874747\n", " 0.874735\n", @@ -5527,7 +5680,16 @@ " 0.874765\n", " \n", " \n", - " 24\n", + " 41\n", + " RandomizedSearchCV(cv=5, estimator=BernoulliNB...\n", + " 0.874747\n", + " 0.874735\n", + " 0.874765\n", + " 0.874742\n", + " 0.874765\n", + " \n", + " \n", + " 42\n", " PassiveAggressiveClassifier()\n", " 0.871970\n", " 0.871954\n", @@ -5542,60 +5704,96 @@ "text/plain": [ " Model Accuracy Precision \\\n", "0 StackingClassifier(estimators=[('ET', ExtraTre... 0.978535 0.978523 \n", - "1 (ExtraTreeClassifier(random_state=191144010), ... 0.976010 0.976301 \n", - "2 VotingClassifier(estimators=[('ET', ExtraTrees... 0.975505 0.975772 \n", - "3 \n", + " 0.976768\n", + " 0.976757\n", + " 0.976780\n", + " 0.976766\n", + " 0.976780\n", + " \n", + " \n", + " 3\n", " (ExtraTreeClassifier(random_state=191144010), ...\n", " 0.976010\n", " 0.976301\n", @@ -7872,7 +8079,7 @@ " 0.976151\n", " \n", " \n", - " 3\n", + " 4\n", " VotingClassifier(estimators=[('ET', ExtraTrees...\n", " 0.975505\n", " 0.975772\n", @@ -7881,7 +8088,7 @@ " 0.975641\n", " \n", " \n", - " 4\n", + " 5\n", " RandomizedSearchCV(cv=5, estimator=HistGradien...\n", " 0.975000\n", " 0.975341\n", @@ -7890,7 +8097,7 @@ " 0.975150\n", " \n", " \n", - " 5\n", + " 6\n", " RandomizedSearchCV(cv=5,\\n e...\n", " 0.974242\n", " 0.974454\n", @@ -7899,7 +8106,7 @@ " 0.974366\n", " \n", " \n", - " 6\n", + " 7\n", " <catboost.core.CatBoostClassifier object at 0x...\n", " 0.974242\n", " 0.974521\n", @@ -7908,7 +8115,7 @@ " 0.974381\n", " \n", " \n", - " 7\n", + " 8\n", " <catboost.core.CatBoostClassifier object at 0x...\n", " 0.974242\n", " 0.974521\n", @@ -7917,7 +8124,7 @@ " 0.974381\n", " \n", " \n", - " 8\n", + " 9\n", " RandomizedSearchCV(cv=5, estimator=KNeighborsC...\n", " 0.973990\n", " 0.974357\n", @@ -7926,7 +8133,7 @@ " 0.974145\n", " \n", " \n", - " 9\n", + " 10\n", " (DecisionTreeClassifier(max_features='auto', r...\n", " 0.972980\n", " 0.973270\n", @@ -7935,7 +8142,7 @@ " 0.973120\n", " \n", " \n", - " 10\n", + " 11\n", " XGBClassifier(base_score=None, booster=None, c...\n", " 0.972475\n", " 0.972841\n", @@ -7944,7 +8151,7 @@ " 0.972630\n", " \n", " \n", - " 11\n", + " 12\n", " RandomizedSearchCV(estimator=ExtraTreesClassif...\n", " 0.970202\n", " 0.970831\n", @@ -7953,7 +8160,7 @@ " 0.970398\n", " \n", " \n", - " 12\n", + " 13\n", " HistGradientBoostingClassifier()\n", " 0.967677\n", " 0.968028\n", @@ -7962,7 +8169,7 @@ " 0.967829\n", " \n", " \n", - " 13\n", + " 14\n", " MLPClassifier()\n", " 0.967172\n", " 0.967382\n", @@ -7971,7 +8178,7 @@ " 0.967295\n", " \n", " \n", - " 14\n", + " 15\n", " RandomizedSearchCV(estimator=LGBMClassifier(),...\n", " 0.967172\n", " 0.967666\n", @@ -7980,7 +8187,7 @@ " 0.967348\n", " \n", " \n", - " 15\n", + " 16\n", " LGBMClassifier()\n", " 0.966919\n", " 0.967257\n", @@ -7989,7 +8196,7 @@ " 0.967069\n", " \n", " \n", - " 16\n", + " 17\n", " RandomizedSearchCV(cv=5, estimator=GradientBoo...\n", " 0.966667\n", " 0.966966\n", @@ -7998,7 +8205,7 @@ " 0.966809\n", " \n", " \n", - " 17\n", + " 18\n", " RandomizedSearchCV(estimator=BaggingClassifier...\n", " 0.966162\n", " 0.966624\n", @@ -8007,7 +8214,7 @@ " 0.966333\n", " \n", " \n", - " 18\n", + " 19\n", " (DecisionTreeClassifier(random_state=157850700...\n", " 0.964646\n", " 0.964781\n", @@ -8016,7 +8223,7 @@ " 0.964750\n", " \n", " \n", - " 19\n", + " 20\n", " KNeighborsClassifier()\n", " 0.957828\n", " 0.959996\n", @@ -8025,7 +8232,7 @@ " 0.958176\n", " \n", " \n", - " 20\n", + " 21\n", " RandomizedSearchCV(cv=5, estimator=SVC(),\\n ...\n", " 0.956061\n", " 0.956487\n", @@ -8034,7 +8241,7 @@ " 0.956226\n", " \n", " \n", - " 21\n", + " 22\n", " DecisionTreeClassifier()\n", " 0.953030\n", " 0.953147\n", @@ -8043,7 +8250,7 @@ " 0.953128\n", " \n", " \n", - " 22\n", + " 23\n", " RandomizedSearchCV(cv=5, estimator=DecisionTre...\n", " 0.946465\n", " 0.946581\n", @@ -8052,7 +8259,7 @@ " 0.946562\n", " \n", " \n", - " 23\n", + " 24\n", " XGBRFClassifier(base_score=None, booster=None,...\n", " 0.944192\n", " 0.944778\n", @@ -8061,7 +8268,7 @@ " 0.944383\n", " \n", " \n", - " 24\n", + " 25\n", " ([DecisionTreeRegressor(criterion='friedman_ms...\n", " 0.942172\n", " 0.942239\n", @@ -8070,7 +8277,7 @@ " 0.942251\n", " \n", " \n", - " 25\n", + " 26\n", " SVC()\n", " 0.941667\n", " 0.942156\n", @@ -8079,7 +8286,7 @@ " 0.941843\n", " \n", " \n", - " 26\n", + " 27\n", " RandomizedSearchCV(cv=5, estimator=AdaBoostCla...\n", " 0.929040\n", " 0.929067\n", @@ -8088,7 +8295,7 @@ " 0.929099\n", " \n", " \n", - " 27\n", + " 28\n", " (DecisionTreeClassifier(max_depth=1, random_st...\n", " 0.923485\n", " 0.923520\n", @@ -8097,7 +8304,7 @@ " 0.923548\n", " \n", " \n", - " 28\n", + " 29\n", " RandomizedSearchCV(cv=5, estimator=PassiveAggr...\n", " 0.906061\n", " 0.906454\n", @@ -8106,7 +8313,7 @@ " 0.906222\n", " \n", " \n", - " 29\n", + " 30\n", " RandomizedSearchCV(cv=5, estimator=LinearSVC()...\n", " 0.905051\n", " 0.905497\n", @@ -8115,7 +8322,7 @@ " 0.905221\n", " \n", " \n", - " 30\n", + " 31\n", " RandomizedSearchCV(cv=5,\\n e...\n", " 0.902778\n", " 0.902843\n", @@ -8124,7 +8331,7 @@ " 0.902854\n", " \n", " \n", - " 31\n", + " 32\n", " LogisticRegression()\n", " 0.902525\n", " 0.902596\n", @@ -8133,7 +8340,7 @@ " 0.902604\n", " \n", " \n", - " 32\n", + " 33\n", " SGDClassifier()\n", " 0.902273\n", " 0.902376\n", @@ -8142,7 +8349,7 @@ " 0.902363\n", " \n", " \n", - " 33\n", + " 34\n", " RandomizedSearchCV(cv=5, estimator=LogisticReg...\n", " 0.902020\n", " 0.902103\n", @@ -8151,7 +8358,7 @@ " 0.902103\n", " \n", " \n", - " 34\n", + " 35\n", " LinearSVC()\n", " 0.901263\n", " 0.901328\n", @@ -8160,7 +8367,7 @@ " 0.901338\n", " \n", " \n", - " 35\n", + " 36\n", " RandomizedSearchCV(cv=5, estimator=SGDClassifi...\n", " 0.897727\n", " 0.897891\n", @@ -8169,7 +8376,7 @@ " 0.897837\n", " \n", " \n", - " 36\n", + " 37\n", " RidgeClassifier()\n", " 0.894697\n", " 0.895429\n", @@ -8178,7 +8385,7 @@ " 0.894913\n", " \n", " \n", - " 37\n", + " 38\n", " RandomizedSearchCV(cv=5, estimator=RidgeClassi...\n", " 0.894697\n", " 0.895429\n", @@ -8187,7 +8394,7 @@ " 0.894913\n", " \n", " \n", - " 38\n", + " 39\n", " NuSVC()\n", " 0.893434\n", " 0.893436\n", @@ -8196,7 +8403,7 @@ " 0.893410\n", " \n", " \n", - " 39\n", + " 40\n", " GaussianNB()\n", " 0.888131\n", " 0.888185\n", @@ -8205,8 +8412,8 @@ " 0.888201\n", " \n", " \n", - " 40\n", - " BernoulliNB()\n", + " 41\n", + " RandomizedSearchCV(cv=5, estimator=BernoulliNB...\n", " 0.874747\n", " 0.874735\n", " 0.874765\n", @@ -8214,8 +8421,8 @@ " 0.874765\n", " \n", " \n", - " 41\n", - " RandomizedSearchCV(cv=5, estimator=BernoulliNB...\n", + " 42\n", + " BernoulliNB()\n", " 0.874747\n", " 0.874735\n", " 0.874765\n", @@ -8223,7 +8430,7 @@ " 0.874765\n", " \n", " \n", - " 42\n", + " 43\n", " PassiveAggressiveClassifier()\n", " 0.871970\n", " 0.871954\n", @@ -8239,95 +8446,97 @@ " Model Accuracy Precision \\\n", "0 StackingClassifier(estimators=[('ET', ExtraTre... 0.978535 0.978523 \n", "1 RandomizedSearchCV(cv=5, estimator=RandomFores... 0.977273 0.977445 \n", - "2 (ExtraTreeClassifier(random_state=191144010), ... 0.976010 0.976301 \n", - "3 VotingClassifier(estimators=[('ET', ExtraTrees... 0.975505 0.975772 \n", - "4 RandomizedSearchCV(cv=5, estimator=HistGradien... 0.975000 0.975341 \n", - "5 RandomizedSearchCV(cv=5,\\n e... 0.974242 0.974454 \n", - "6