Skip to content

Mythamor/Django_Asset_Finance_Risk_Assessment_Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Asset Finance Risk Assessment Model

Django.Risk.Assessment.mp4

Overview

Django Asset Finance Risk Assessment Model is a machine learning application designed to assess the credit risk of individuals applying for asset financing. This model provides financial institutions with insights into the likelihood of loan default and estimates the amount of credit that can be extended to applicants.

Key Features

  • Binary Classification: Predicts whether an applicant is likely to default on their loan (default or non-default).
  • Linear Regression: Estimates the maximum loan amount an applicant can borrow based on their financial and demographic features.
  • Django Integration: Built with Django for easy deployment in web applications.

Table of Contents

  1. Installation
  2. Usage
  3. Data Preprocessing
  4. Model Training
  5. Evaluation
  6. API Endpoints
  7. Contributing
  8. License

Installation

To set up the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/Django_Asset_Finance_Risk_Assessment_Model.git
    cd Django_Asset_Finance_Risk_Assessment_Model
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt
  4. Run database migrations:

    python manage.py migrate
  5. Start the development server:

    python manage.py runserver

Usage

  1. Access the application: Open your web browser and navigate to http://127.0.0.1:8000/.
  2. Input data: Fill in the application form with the required financial and demographic details.
  3. Submit: Click the submit button to see the predicted default status and recommended loan amount.

Data Preprocessing

Before training the model, data is cleaned and processed, which includes:

  • Handling missing values
  • Encoding categorical variables
  • Normalizing or scaling numerical features

The preprocessing steps are detailed in the data_preprocessing.py module.

Model Training

The model is trained using the following steps:

  1. Load Data: Import the dataset and split it into training and testing sets.
  2. Feature Selection: Select relevant features for the model based on domain knowledge.
  3. Training: Fit the binary classification model and linear regression model on the training data.
  4. Hyperparameter Tuning: Optimize model parameters using techniques such as grid search or random search.

Refer to the model_training.py module for detailed code.

Evaluation

Model performance is evaluated using:

  • Accuracy, Precision, Recall, and F1 Score for the classification model
  • Mean Absolute Error (MAE) and R-squared for the regression model

Results are logged in the model_evaluation.py module.

API Endpoints

The application exposes the following API endpoints:

  • POST /api/evaluate/: Submits applicant data and returns predicted default status and loan amount.
    • Request Body:

      {
        "feature1": value,
        "feature2": value,
        ...
      }
    • Response:

      {
        "default_status": "default or non-default",
        "recommended_loan_amount": amount
      }

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Credit risk evaluator for asset financing that incorporates both binary classification and regression models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages