Define the target and thresholds
Decide whether affordability is framed as a regression (max affordable payment) or a classification (affordable / not affordable) and document economic thresholds and loss asymmetry.
Predict mortgage affordability. Require human financial review.
Mortgage-affordability prediction estimates whether an applicant can afford a loan given income, liabilities, property and market features. Useful error modes include distribution shift across regions, missing income documentation, biased training labels and model overconfidence on rare applicant profiles.
Learning concept · Not a validated service
Mortgage-affordability prediction estimates whether an applicant can afford a loan given income, liabilities, property and market features. Useful error modes include distribution shift across regions, missing income documentation, biased training labels and model overconfidence on rare applicant profiles.
A proposed application: screen loan enquiries to prioritise manual underwriting work. The automated score should be advisory only and every declined or high-value decision must be confirmed by a licensed human underwriter. This extension is not implemented in the supplied starter code.
Decide whether affordability is framed as a regression (max affordable payment) or a classification (affordable / not affordable) and document economic thresholds and loss asymmetry.
Collect borrower income, liabilities, credit history, loan terms and local housing prices, and guard against label bias and privacy concerns before splitting.
Fit a reproducible baseline (eg. scaled tree ensemble) with cross-validation, record metrics that match decision costs, and log data versions.
Measure AUC, precision/recall at operational thresholds, calibration and disparate impact; route borderline predictions to human reviewers.
The supplied starter generates a synthetic binary classification dataset with sklearn.make_classification, wraps a StandardScaler and RandomForestClassifier in a Pipeline, fits on a random train/test split and prints a sklearn classification_report. It does not use mortgage features, real borrower records, or domain-specific preprocessing.
X, y = make_classification(
n_samples=800,
n_features=10,
n_informative=6,
n_redundant=2,
random_state=RANDOM_STATE,
)
feature_names = [f"feature_{i}" for i in range(X.shape[1])]
data = pd.DataFrame(X, columns=feature_names)
data["target"] = y
The starter uses synthetic features from sklearn.make_classification rather than borrower, property or market data. Consequently its metrics do not validate mortgage-affordability performance, fairness or regulatory compliance. The small, simulated labelling does not exercise real-world covariate shift, missing-documentation cases or label-generation bias that are central to production mortgage models.
A proposed extension: replace the synthetic data with an anonymised, consented borrower dataset, add domain-specific feature engineering (DTI ratios, loan-to-value, regional price indices), and produce a calibrated score that routes uncertain cases to underwriters.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.