{"id":21432396,"url":"https://github.com/lingumd/credit_risk_analysis","last_synced_at":"2026-04-17T00:02:26.930Z","repository":{"id":108128018,"uuid":"554579702","full_name":"lingumd/Credit_Risk_Analysis","owner":"lingumd","description":"Machine learning models for predicting credit risk in LendingClub dataset.","archived":false,"fork":false,"pushed_at":"2022-10-23T23:29:16.000Z","size":27855,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T22:37:50.217Z","etag":null,"topics":["balancedrandomforestclassifier","classification-report","cluster-centroids-undersampling","confusion-matrix","easyensembleclassifier","get-dummies","google-colab","imbalanced-learn","machine-learning","matplotlib-pyplot","numpy","pandas","pathlib","randomoversampler","scikit-learn","smote","smoteenn"],"latest_commit_sha":null,"homepage":"","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/lingumd.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":"2022-10-20T03:23:43.000Z","updated_at":"2022-12-06T07:02:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"226925d1-1e6e-487c-bf37-80396bde5831","html_url":"https://github.com/lingumd/Credit_Risk_Analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lingumd/Credit_Risk_Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingumd%2FCredit_Risk_Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingumd%2FCredit_Risk_Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingumd%2FCredit_Risk_Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingumd%2FCredit_Risk_Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lingumd","download_url":"https://codeload.github.com/lingumd/Credit_Risk_Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingumd%2FCredit_Risk_Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31909235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["balancedrandomforestclassifier","classification-report","cluster-centroids-undersampling","confusion-matrix","easyensembleclassifier","get-dummies","google-colab","imbalanced-learn","machine-learning","matplotlib-pyplot","numpy","pandas","pathlib","randomoversampler","scikit-learn","smote","smoteenn"],"created_at":"2024-11-22T23:18:24.918Z","updated_at":"2026-04-17T00:02:26.884Z","avatar_url":"https://github.com/lingumd.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Credit_Risk_Analysis\n\n## Overview\nEmploy different techniques to train and evaluate models with unbalanced classes. Use imbalanced-learn and scikit-learn libraries to build and evaluate models using resampling. \n\nUsing the credit card credit dataset from LendingClub, a peer-to-peer lending services company, oversample the data using the RandomOverSampler and SMOTE algorithms, and undersample the data using the ClusterCentroids algorithm. Then, use a combinatorial approach of over- and undersampling using the SMOTEENN algorithm. Next, compare two new machine learning models that reduce bias, BalancedRandomForestClassifier and EasyEnsembleClassifier, to predict credit risk. Evaluate the performance of these models and make a written recommendation on whether they should be used to predict credit risk.\n\n## Results\n\nUsing bulleted lists, describe the balanced accuracy scores and the precision and recall scores of all six machine learning models. Use screenshots of your outputs to support your results.\n\n### Oversampling\n- The accuracy score is 0.8325468421491353.\n- Confusion Matrix:\n\n![oversamplingcm](./Images/Oversampling_confusion_matrix.png)\n\n- Imbalanced Classification Report: \n\n![oversampling_report](./Images/Oversampling_report.png)\n\n### SMOTE Oversampling\n- The accuracy score is 0.8440938486973113.\n- Confusion Matrix:\n\n![SMOTEcm](./Images/SMOTE_confusion_matrix.png)\n\n- Imbalanced Classification Report: \n\n![SMOTE_report](./Images/SMOTE_report.png)\n\n### Undersampling(Cluster Centroids)\n- The accuracy score is 0.8203882595930314.\n- Confusion Matrix: \n\n![undersamplingcm](./Images/ClusterCentroids_confusion_matrix.png)\n\n- Imbalanced Classification Report: \n\n![undersampling_report](./Images/ClusterCentroids_report.png)\n\n### Combination (Over and Under) Sampling (SMOTEEN)\n- The accuracy score is 0.844016280135965.\n- Confusion Matrix:\n\n![combosamplingcm](./Images/SMOTEEN_confusion_matrix.png)\n\n- Imbalanced Classification Report: \n\n![combosampling_report](./Images/SMOTEEN_report.png)\n\n### Balanced Random Forest Classifier\n- The accuracy score is 0.7589504857875872\n- Confusion Matrix:\n\n![brfcm](./Images/BalancedRandomForest_confusion_matrix.png)\n\n- Imbalanced Classification Report: \n\n![brf_report](./Images/BalancedRandomForest_report.png)\n\n- The features are sorted in descending order by feature importance:\n\n![feature_importance](./Images/feature_importance_matrix.png)\n\n### Easy Ensemble AdaBooster Classifier\n- The accuracy score is 0.9319231677611166\n- Confusion Matrix:\n\n![eecm](./Images/EasyEnsemble_confusion_matrix.png)\n\n- Imbalanced Classification Report: \n\n![ee_report](./Images/EasyEnsemble_report.png)\n\n\n## Summary\nThe resampling models and The BalancedRandomForestClassifier had low f1 scores(0.04-0.07).\n\nThe EasyEnsembleClassifier performed the best in classifying the credit risk as high risk with an f1 score of 0.16. Therefore, I would recommend using the EasyEnsembleClassifier to predict credit risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingumd%2Fcredit_risk_analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flingumd%2Fcredit_risk_analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingumd%2Fcredit_risk_analysis/lists"}