Django.Risk.Assessment.mp4
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.
- 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.
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/Django_Asset_Finance_Risk_Assessment_Model.git cd Django_Asset_Finance_Risk_Assessment_Model -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run database migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
- Access the application: Open your web browser and navigate to
http://127.0.0.1:8000/. - Input data: Fill in the application form with the required financial and demographic details.
- Submit: Click the submit button to see the predicted default status and recommended loan amount.
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.
The model is trained using the following steps:
- Load Data: Import the dataset and split it into training and testing sets.
- Feature Selection: Select relevant features for the model based on domain knowledge.
- Training: Fit the binary classification model and linear regression model on the training data.
- Hyperparameter Tuning: Optimize model parameters using techniques such as grid search or random search.
Refer to the model_training.py module for detailed code.
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.
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 }
-
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.