PitchHut logo
Loan Prediction API with 88.62% accuracy
Streamlined AI-driven predictions for loan approvals with a lightweight API
Pitch

The Loan Prediction API offers a robust and efficient solution for predicting loan approvals. With multiple trained models and a simple REST interface, it facilitates seamless integration into applications, enabling accurate loan predictions quickly and easily. Ideal for developers looking to enhance their financial applications.

Description

Loan Prediction API

The Loan Prediction API is a production-ready artificial intelligence system designed to facilitate loan approval predictions through a streamlined, lightweight REST API. It incorporates multiple trained machine learning models, enhancing accuracy to 88.62%. The API is accessible for public use via a demo interface and features comprehensive documentation.

Key Features

  • High Accuracy: Supports multiple models to ensure reliable predictions.
  • RESTful API Design: Simple integration capabilities for developers.
  • Interactive Documentation: Explore the API with Swagger UI for ease of use.
  • Input Validation: Validates application data to improve prediction quality.
  • Test Coverage: Maintains an 83% coverage to ensure code reliability.

API Overview

  • Base URL:
    • Development: http://localhost:5000
    • Production: Live Demo
  • Endpoints:
    • GET /: Retrieve API information and statistics.
    • POST /predict: Submit loan application details for prediction.
    • GET /history: Access recent prediction history.
    • GET /statistics: Fetch overall API statistics.

Example Usage

Make a Prediction

Submit loan details to receive a prediction with confidence levels:

{
  "ApplicantIncome": 5000,
  "CoapplicantIncome": 1500,
  "LoanAmount": 150,
  "Loan_Amount_Term": 360,
  "Credit_History": 1,
  "Gender": "Male",
  "Married": "Yes",
  "Dependents": "0",
  "Education": "Graduate",
  "Self_Employed": "No",
  "Property_Area": "Urban"
}

Response Example

The prediction will return a success flag, the predicted status of the loan, confidence, and probability distribution:

{
  "success": true,
  "prediction": "Approved",
  "confidence": 0.89,
  "probability": {
    "rejected": 0.11,
    "approved": 0.89
  }
}

Technology Stack

  • Backend: Flask 3.x with Gunicorn
  • Database: PostgreSQL for production, SQLite for development
  • Machine Learning: scikit-learn, pandas, numpy
  • Testing Framework: pytest

Deployment and Development

Effortlessly deploy the API using services like Render, enabling continuous integration directly from GitHub. Developers can run the API locally using Python and Docker, facilitating a seamless development process.

Additional Resources

The Loan Prediction API aims to improve financial decision-making processes through data-driven insights, making the loan approval process more efficient and accessible.

0 comments

No comments yet.

Sign in to be the first to comment.