hiring_assessment/backend/app/services/house_price_predictor.py
2025-02-19 17:38:26 +01:00

17 lines
478 B
Python

class HousePricePredictor:
"""
Mock ML model that predicts house prices.
In a real scenario, this would load a trained model.
"""
async def predict(
self, square_feet: float, bedrooms: int, bathrooms: float
) -> float:
base_price = square_feet * 200
bedroom_value = bedrooms * 25000
bathroom_value = bathrooms * 15000
predicted_price = base_price + bedroom_value + bathroom_value
return predicted_price