Skip to content

chaitanya2593/Credit_Risk_Analysis

Repository files navigation

Credit Risk Analysis

Table of Contents
  1. About The Project
  2. Built With
  3. Code Usage
  4. Data Files
  5. Deployment
  6. License
  7. Contact
  8. Reference

About The Project

Product Name Screen Shot

In this project explained how to implement the random forest on a credit risk data using jupyter notebook. Followed by deploying the model using the heroku.

(back to top)

Built With

  • Python - 3x
    • Data science packages
    • Dash
  • Jupyter Notebooks / google colabs
  • HTML code

(back to top)

Code Usage

Overall end-to-end process has been divided into 4 steps. The execution of the files should also be in the same order. In individual the required input files are already mentioned in the code comments.

DataScience

  • 1_EDA.ipynb
    • Performing teh exploratory data analysis on the credit risk data.
  • 2_Model_Buidling.ipynb
    • Building a Random forest model and saving the model as a file.
  • 3_Credit_Risk_Prediction.ipynb
    • Loading the model and predicting new data
  • 4 heroku deployment
    • The model is deployed as a app.

(back to top)

Data Files

The dataset for the project is extarcted from the kaggle competetion.

  https://www.kaggle.com/code/turanmehdiyeva/credit-risk-descriptive-statistical-analysis/data

(back to top)

Deployment

  • At first, during preprocessing the categorical variables label encoded and this encoding objects are stored by in label_dict.pkl and similar min_max_scaler.pkl file for the normalisation.
  • Then creating an account in heruko for free. Then created a dash python file named app.py(for convenience I used the generic name). As DASH uses flask, the app was built for a flask deployment and it doesn't support static files.
  • As third step I have designed code to capture all the required fields for the model prediction.
  • The model is tested locally just by invoking python file python app.py.
  • Now it is more of app deployment in heroku

(back to top)

Heroku deployment

As a prerequsite, one should have the following things

  1. An account in the Heroku https://dashboard.heroku.com/

In the git folder one should below files 2. requirements.txt - with all the python packages required for app. 3. Procfile - an no extension file with command web: gunicorn app:server (if you are using different name for the main dash file please replace the same in the command) 4. Define which python runtime you want for your model in runtime.txt, Please also check if the runtime is compatible with heroku. 5. Build the app.py with the required fields 6. Finally, push the code to the repo

(back to top)

App Building

In this step it is more about deploying the app in heroku app.

  1. Login to Heroku and navigate to apps
  2. create new app with the names available (be creative ).
  3. Now navigate to the 'Deploy' tab and like your github under "Deployment method'"
  4. Under Connect to Github -> please provide the repo name in which the app is placed
  5. Under Manual Deploy -> please select tge branch and click "Deploy branch"
  6. Once this is successfully done you should get the url to access the website. In my case it is - https://cr369.herokuapp.com/

(back to top)

License

Distributed under the GNU License. See LICENSE.txt for more information.

(back to top)

Contact

Developed by Frankfurt School Data Science initiative members.

LinkedIn | Instagram

Project Link: https://github.com/chaitanya2593/CRA_pratice

(back to top)

References:

About

Credit_Risk_Analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published