Giter Site home page Giter Site logo

tar-ive / credit-risk Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.79 MB

Credit Default Prediction is a web application that predicts whether a customer will default on their credit based on various financial factors. The application uses an XGBoost model to make predictions and presents the results in an easy-to-use web interface.

Home Page: https://credit-risk.netlify.app/

HTML 66.52% Python 33.48%

credit-risk's Introduction

Credit Default Prediction

Live Demo

Overview

Credit Default Prediction is a web application that predicts whether a customer will default on their credit based on various financial factors. The application uses an XGBoost model to make predictions and presents the results in an easy-to-use web interface.

Features

  • Predicts credit default using multiple financial features
  • Displays the prediction (Default or No Default) without showing the probability
  • Provides an explanation of the key factors influencing the prediction
  • Visualizes input feature values and the relationship between age and debt ratio

Technologies Used

  • Backend: Python, Flask, Gunicorn
  • Frontend: HTML, CSS, JavaScript, Chart.js
  • Machine Learning: Scikit-learn (XGBoost)
  • Deployment: Docker, Google App Engine

Prerequisites

Ensure you have the following installed on your machine:

  • Python 3.9
  • Docker
  • Google Cloud SDK (for deployment)

Local Setup

Follow these steps to set up the application locally:

  1. Clone the Repository

    git clone https://github.com/Tar-ive/credit-risk.git
    cd credit-default-prediction
  2. Create and Activate Virtual Environment

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install Dependencies

    pip install -r requirements.txt
  4. Run the Flask Application

    gunicorn --bind :8080 model:app

    Access the application at http://localhost:8080.

  5. Docker Setup

    Build Docker Image:

    docker build -t credit-prediction-app .

    Run Docker Container:

    docker run -p 8080:8080 credit-prediction-app

    Access the application at http://localhost:8080.

Deployment to Google App Engine

  1. Authenticate with GCP

    gcloud auth login
  2. Set Your GCP Project

    gcloud config set project YOUR_PROJECT_ID
  3. Deploy the Application

    gcloud app deploy
  4. Access the Deployed Application Navigate to https://YOUR_PROJECT_ID.uc.r.appspot.com.

Usage

  1. Navigate to the Web Application
  2. Input Financial Data
  3. Get Prediction
  4. View Explanation and Charts

File Structure

  • app.yaml: Configuration file for Google App Engine
  • Dockerfile: Docker configuration file
  • requirements.txt: Python dependencies
  • model.py: Main application code
  • index.html: Frontend code

Contributing

Feel free to open issues or submit pull requests for improvements and bug fixes.

License

This project is licensed under the MIT License.

Acknowledgements

Inspired by various credit risk prediction projects and tutorials from LEARNERA.

credit-risk's People

Contributors

tar-ive avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.