Spaces:
Sleeping
Sleeping
| from pydantic import BaseModel, Field | |
| from typing import Optional | |
| from datetime import datetime | |
| class LoanApplicationBase(BaseModel): | |
| applicant_name: Optional[str] = "Applicant" | |
| gender: str = Field(..., description="Male or Female") | |
| married: str = Field(..., description="Yes or No") | |
| dependents: str = Field(..., description="0, 1, 2, 3+") | |
| education: str = Field(..., description="Graduate or Not Graduate") | |
| self_employed: str = Field(..., description="Yes or No") | |
| applicant_income: float = Field(..., description="Monthly Applicant Income") | |
| coapplicant_income: float = Field(..., description="Monthly Co-applicant Income") | |
| loan_amount: float = Field(..., description="Total Loan AmountRequested") | |
| loan_amount_term: float = Field(..., description="Loan Term in Months") | |
| credit_history: float = Field(..., description="1.0 for Yes, 0.0 for No") | |
| property_area: str = Field(..., description="Urban, Semiurban, Rural") | |
| class LoanApplicationCreate(LoanApplicationBase): | |
| pass | |
| class LoanApplicationResponse(LoanApplicationBase): | |
| id: int | |
| prediction: str | |
| confidence: float | |
| dti_ratio: float | |
| explanation_text: Optional[str] = None | |
| optimized_suggestion: Optional[str] = None | |
| feature_importance_json: Optional[str] = None | |
| benchmarks_json: Optional[str] = None | |
| created_at: datetime | |
| class Config: | |
| from_attributes = True | |