Skip to content

API is designed to predict property prices based on geographical coordinates.

Notifications You must be signed in to change notification settings

Loke-60000/SquareMeterPricingPredictorAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Property Price Prediction API Documentation


Table of Contents

  1. Overview
  2. Endpoints
  3. How to Run
  4. Error Handling

Overview

This API is designed to predict property prices based on geographical coordinates. It utilizes a decision tree model to estimate property prices per square meter at a given latitude and longitude.


Endpoints

1. Predict Property Price

  • URL: /predict_get
  • Method: GET
  • Query Params:
    • latitude=[float] (required)
    • longitude=[float] (required)
  • Success Response: JSON object with the predicted price per square meter.
  • Error Response:
    • 400 Bad Request if query parameters are missing or invalid
    • 503 Service Unavailable if the model is not loaded
    • 500 Internal Server Error for other issues
  • Example: http://localhost:5000/predict_get?latitude=48.8566&longitude=2.3522

How to Run

  • Ensure FastAPI, Uvicorn, and necessary dependencies are installed.
  • Load the decision tree model named decision_tree_model.pkl.
  • Run the server using uvicorn main:app --host=localhost --port=5000, with main.py being the script containing the FastAPI app.
  • Access the API at http://localhost:5000.

Error Handling

  • Custom error handling is implemented to manage internal server errors.
  • The server returns appropriate error messages and HTTP status codes based on the nature of the error encountered.
  • The API checks for the model's availability before making predictions, ensuring reliable responses.

About

API is designed to predict property prices based on geographical coordinates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages