🌍 Machine Learning · subject
Machine Learning Project: Predicting House Prices Syllabus
The Project: Predicting House Prices syllabus for Machine Learning in full: 7 chapters, 15 topics and 31 sub-topics, every one listed below, plus 50 Project: Predicting House Prices flashcards with answers.
Project: Predicting House Prices syllabus: all 7 chapters
Expand any chapter to see its topics and sub-topics.
-
Define the Problem
2 topics- Identify the Objective
- Determine the target variable
- Specify the prediction task
- Understand the Business Context
- Gather domain knowledge
- Identify stakeholders
- Identify the Objective
-
Collect Data
2 topics- Identify Data Sources
- Public datasets
- Proprietary datasets
- Gather Data
- Download datasets
- Merge datasets
- Identify Data Sources
-
Data Preprocessing
3 topics- Data Cleaning
- Handle missing values
- Remove duplicates
- Feature Engineering
- Create new features
- Encode categorical variables
- Data Transformation
- Normalize/Standardize data
- Split data into training and testing sets
- Data Cleaning
-
Model Selection
2 topics- Choose Algorithms
- Linear Regression
- Decision Trees
- Random Forest
- Gradient Boosting
- Model Training
- Train models on training data
- Tune hyperparameters
- Choose Algorithms
-
Model Evaluation
2 topics- Assess Model Performance
- Evaluate on testing data
- Use metrics like RMSE, MAE
- Compare Models
- Select the best performing model
- Assess Model Performance
-
Model Deployment
2 topics- Prepare for Deployment
- Serialize the model
- Develop API for model inference
- Deploy the Model
- Host the model on a server
- Monitor model performance
- Prepare for Deployment
-
Model Maintenance
2 topics- Monitor Model Performance
- Track prediction accuracy
- Update model with new data
- Retrain Model
- Periodically retrain with updated data
- Re-deploy updated model
- Monitor Model Performance
Machine Learning Project: Predicting House Prices flashcards — 50 questions with answers
In a machine learning project, what does 'Identifying the Objective' mean, and what is the objective for the House Prices project?
It means defining the precise problem the model must solve and the target variable to predict. For House Prices, the objective is to predict the continuous sale price of a house from its features — a supervised regression task.
Why is predicting house prices classified as a regression problem rather than classification?
Because the target variable (price) is a continuous numeric value, not a discrete category. Regression predicts continuous outputs; classification predicts discrete labels.
What is the difference between a business objective and a machine learning objective in a project?
The business objective is the real-world goal (e.g., help buyers/sellers price homes accurately). The ML objective is the technical translation of it (e.g., minimize prediction error $\text{RMSE}$ on house price).
In 'Understanding the Business Context' for house price prediction, who are typical stakeholders and how would they use the model?
Stakeholders include real-estate agents, buyers, sellers, lenders, and appraisers. They use predicted prices to set listing prices, make offers, assess loan collateral, and detect over/under-priced listings.
What is a 'success metric' agreed upon in the business-context stage, and give an example for house prices.
A quantitative target that defines acceptable model performance, e.g., 'mean absolute error under \$15,000' or 'predictions within 10% of actual price for 80% of homes'.
What are 'structured' vs 'unstructured' data sources, with examples for a housing dataset?
Structured data is organized in tables/rows-columns (e.g., square footage, bedrooms, year built). Unstructured data has no fixed schema (e.g., listing photos, free-text descriptions).
Name three categories of data sources you might identify for a house-price model.
Internal records (past sale transactions), public/government data (tax records, census, geographic data), and third-party/API data (Zillow-like listings, mortgage rates, neighborhood crime/school ratings).
What is the difference between primary and secondary data sources?
Primary data is collected first-hand for the specific purpose (e.g., your own sales database). Secondary data is collected by others and reused (e.g., census or open real-estate datasets).
In the 'Gather Data' step, what is the difference between batch and streaming (real-time) data collection?
Batch collection gathers data in large chunks at intervals (e.g., nightly export of sales). Streaming collection ingests data continuously as it is generated (e.g., live listing updates).
What is data 'sampling' and why might you sample when gathering a large housing dataset?
Sampling selects a representative subset of the full data. It reduces compute and storage cost while preserving the population's statistical properties, enabling faster experimentation.
Define stratified sampling and why it helps in house-price data.
Stratified sampling divides data into subgroups (strata, e.g., price ranges or neighborhoods) and samples proportionally from each, ensuring the sample mirrors the population's distribution and avoids bias toward common groups.
What are the main goals of the 'Data Cleaning' step?
To handle missing values, remove duplicates, fix inconsistent formats, correct errors, and address outliers — producing a reliable, consistent dataset for modeling.
List three common strategies for handling missing values in a housing dataset.
Deletion (drop rows/columns with missing data), imputation (fill with mean/median/mode or a model-based estimate), and using a 'missing' indicator flag to mark absence as informative.
Why is the median often preferred over the mean for imputing missing house prices or areas?
Because price/area distributions are right-skewed with outliers; the median is robust to extreme values, whereas the mean is pulled toward them, distorting the imputed value.
What is an outlier, and name one statistical method to detect outliers in house data.
An outlier is an observation far from the rest of the data. The IQR method flags values below $Q_1 - 1.5\,\text{IQR}$ or above $Q_3 + 1.5\,\text{IQR}$, where $\text{IQR} = Q_3 - Q_1$.
Give the z-score formula used to detect outliers and the common threshold.
$$z = \frac{x - \mu}{\sigma}$$ Values with $|z| > 3$ are typically treated as outliers.
What is Feature Engineering and why is it important for house-price models?
It is the creation of new input features from raw data to better expose patterns to the model. Good features (e.g., price-per-sqft, house age) often improve accuracy more than changing the algorithm.
Give two examples of engineered features for a house-price dataset.
Age of house = current year − year built; total bathrooms = full + 0.5 × half baths; price per square foot; or distance to city center derived from latitude/longitude.
What is one-hot encoding and when is it used in feature engineering?
It converts a categorical variable into binary columns, one per category, with a 1 marking the present category. Used for nominal categories (e.g., neighborhood, house style) that have no inherent order.
What is the difference between label encoding and one-hot encoding?
Label encoding assigns each category an integer (suited to ordinal data with order). One-hot encoding creates separate binary columns (suited to nominal data) and avoids implying a false ordering.
Show the other 30 Project: Predicting House Prices flashcards
What is feature selection, and name one technique for it.
Choosing the most relevant subset of features to reduce noise and overfitting. Techniques include correlation filtering, recursive feature elimination (RFE), or regularization (Lasso) that shrinks weak coefficients to zero.
What is Data Transformation and how does it differ from data cleaning?
Transformation changes the scale, distribution, or representation of data (scaling, normalizing, encoding) to suit algorithms. Cleaning fixes errors/missing values; transformation reshapes already-clean data.
Give the formula for min-max normalization and its output range.
$$x' = \frac{x - x_{\min}}{x_{\max} - x_{\min}}$$ It rescales values to the range $[0, 1]$.
Give the formula for standardization (z-score scaling) and describe its result.
$$x' = \frac{x - \mu}{\sigma}$$ It produces features with mean $0$ and standard deviation $1$.
Why is a log transformation often applied to the house-price target variable?
Prices are right-skewed; applying $y' = \log(y)$ compresses large values, makes the distribution more normal, stabilizes variance, and helps linear models fit better.
Which types of algorithms require feature scaling and which generally do not?
Distance/gradient-based models (KNN, SVM, linear/logistic regression, neural networks) require scaling. Tree-based models (decision trees, random forests, gradient boosting) generally do not, since they split on thresholds.
In 'Choosing Algorithms', name three regression algorithms suitable for predicting house prices.
Linear regression, decision tree regression, and ensemble methods such as random forest or gradient boosting (e.g., XGBoost). Also K-nearest neighbors and support vector regression.
State the linear regression model equation for house-price prediction.
$$\hat{y} = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_n x_n$$ where $\hat{y}$ is predicted price, $x_i$ are features, and $\beta_i$ are learned coefficients.
Compare linear regression and random forest for house prices in terms of interpretability and nonlinearity.
Linear regression is highly interpretable but assumes linear relationships. Random forest captures nonlinear interactions and is more accurate on complex data, but is less interpretable (a 'black box').
What is the difference between bagging and boosting ensemble methods?
Bagging (e.g., random forest) trains models in parallel on bootstrap samples and averages them to reduce variance. Boosting (e.g., gradient boosting) trains models sequentially, each correcting the previous one's errors, reducing bias.
What happens during the 'Model Training' step?
The algorithm learns parameters by fitting the training data — minimizing a loss function so predictions approximate true prices, iteratively adjusting weights/coefficients.
What is a loss (cost) function, and give the Mean Squared Error formula used in regression training.
A function measuring prediction error that the model minimizes. MSE is $$\text{MSE} = \frac{1}{n}\sum_{i=1}^{n}(y_i - \hat{y}_i)^2.$$
Explain the purpose of splitting data into training, validation, and test sets.
Training set fits the model, validation set tunes hyperparameters and selects models, and the test set gives an unbiased final estimate of generalization on unseen data.
What is k-fold cross-validation and why is it used during training?
Data is split into $k$ folds; the model trains on $k-1$ folds and validates on the remaining one, rotating $k$ times and averaging results. It gives a robust performance estimate and reduces dependence on a single split.
Distinguish overfitting from underfitting in a house-price model.
Overfitting: model learns noise, low training error but high test error (high variance). Underfitting: model too simple, high error on both training and test sets (high bias).
What is the difference between a model parameter and a hyperparameter?
Parameters (e.g., regression coefficients $\beta_i$) are learned from data during training. Hyperparameters (e.g., tree depth, learning rate) are set before training and control how learning proceeds.
In 'Assessing Model Performance', give the Mean Absolute Error (MAE) formula.
$$\text{MAE} = \frac{1}{n}\sum_{i=1}^{n}|y_i - \hat{y}_i|$$
Give the Root Mean Squared Error (RMSE) formula and explain why it is popular for house prices.
$$\text{RMSE} = \sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_i - \hat{y}_i)^2}$$ It is in the same units as price (dollars) and penalizes large errors more heavily than MAE.
How does RMSE differ from MAE in sensitivity to outliers?
RMSE squares errors, so large errors dominate, making it more sensitive to outliers. MAE weights all errors linearly and is more robust to outliers.
Give the formula and interpretation of the coefficient of determination $R^2$.
$$R^2 = 1 - \frac{\sum_i (y_i - \hat{y}_i)^2}{\sum_i (y_i - \bar{y})^2}$$ It is the proportion of variance in price explained by the model; $1$ is perfect, $0$ means no better than predicting the mean.
What does an $R^2$ value of 0.85 mean for a house-price model?
The model explains 85% of the variance in house prices; the remaining 15% is unexplained by the model's features.
What is Mean Absolute Percentage Error (MAPE) and why is it useful for prices?
$$\text{MAPE} = \frac{100\%}{n}\sum_{i=1}^{n}\left|\frac{y_i - \hat{y}_i}{y_i}\right|$$ It expresses error as a percentage, making accuracy interpretable across different price ranges.
In 'Comparing Models', what makes a fair comparison between two candidate models?
Evaluating all models on the same test/validation data with the same metric(s) (e.g., RMSE, $R^2$), ideally via cross-validation, so differences reflect model quality not data luck.
When two models have similar accuracy, what other factors guide model selection?
Interpretability, training/inference speed, scalability, robustness, maintenance cost, and complexity. The simplest model that meets requirements is usually preferred (parsimony / Occam's razor).
What is the bias-variance tradeoff and how does it inform model comparison?
Simple models have high bias, low variance (underfit); complex models have low bias, high variance (overfit). The best model balances both to minimize total expected error on unseen data.
What does 'Preparing for Deployment' involve before a model goes live?
Finalizing/retraining the model on full data, serializing it (saving weights), packaging dependencies, building an API or pipeline, validating on production-like data, and setting up the serving environment.
What is model serialization and name a common format/tool.
Saving a trained model to a file so it can be reloaded without retraining. Common methods include Python pickle, joblib, or framework formats like ONNX, TensorFlow SavedModel, or PMML.
Differentiate batch (offline) deployment from real-time (online) deployment.
Batch deployment scores many records on a schedule (e.g., nightly price estimates). Real-time deployment serves predictions on demand via an API as requests arrive (e.g., instant price quote).
What is model/data drift, and why must you 'Monitor Model Performance' after deployment?
Drift is the change in data distribution (data drift) or input-output relationship (concept drift) over time, e.g., a changing housing market. Monitoring detects degrading accuracy so the model can be corrected before it harms decisions.
When should you 'Retrain the Model', and what triggers it?
Retrain when monitoring shows performance has dropped below a threshold, when significant drift is detected, or on a regular schedule as new sale data accumulates — restoring accuracy with up-to-date data.
Machine Learning Project: Predicting House Prices FAQ
What is in the Machine Learning Project: Predicting House Prices syllabus?
Machine Learning Project: Predicting House Prices is split into 7 chapters: Define the Problem, Collect Data, Data Preprocessing, Model Selection, Model Evaluation, Model Deployment and Model Maintenance. Together they contain 15 topics and 31 sub-topics.
How many chapters are in Machine Learning Project: Predicting House Prices?
7 chapters, containing 15 topics and 31 sub-topics. The largest chapter is Data Preprocessing, with 3 topics.
Are there flashcards for Machine Learning Project: Predicting House Prices?
Yes — a 50-card Project: Predicting House Prices deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.