File size: 528 Bytes
9e03a51 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from __future__ import annotations
from pydantic import BaseModel, Field
class HouseFeatures(BaseModel):
OverallQual: int = Field(7, ge=1, le=10)
GrLivArea: int = Field(1800, ge=200)
GarageCars: int = Field(2, ge=0, le=5)
TotalBsmtSF: int = Field(1000, ge=0)
FullBath: int = Field(2, ge=0, le=5)
YearBuilt: int = Field(1995, ge=1800, le=2026)
Neighborhood: str = "Somerst"
HouseStyle: str = "2Story"
class PredictionResponse(BaseModel):
predicted_price: float
currency: str = "USD"
|