House price prediction
Problem description
Estimating the price of a house from its area, number of rooms, age and distance from the centre. The data is synthetic.
Objectives
- Building and comparing regression models
- Reading MAE, RMSE and R²
- Understanding when a linear model is enough
Problem type
Regression
Dataset
Tools used
Algorithms
Implementation steps
- In KNIME: File → Import KNIME Workflow… and choose house-prices.knwf, then Execute all.
- Open house-prices.ows in Orange.
- Compare Linear Regression, Tree and Random Forest in Test and Score.
- In WEKA: open houses-synthetic.arff → Classify → LinearRegression, then M5P and RandomForest.
- Plot the errors against the true values to look for a pattern.
Workflow diagram
Orange
DataEvaluateVisualizeModel
↔ Drag the diagram sideways to see all of it.
Connections as text (6)
- File → Data Table (Data)
- File → Test and Score (Data)
- File → Scatter Plot (Data)
- Linear Regression → Test and Score (Learner)
- Tree → Test and Score (Learner)
- Random Forest → Test and Score (Learner)
KNIME
SourceManipulatorLearnerPredictorOtherData portModel port
↔ Drag the diagram sideways to see all of it.
Connections as text (10)
- CSV Reader → Missing Value
- Missing Value → Partitioning
- Partitioning → Linear Regression Learner
- Linear Regression Learner → Regression Predictor
- Regression Predictor → Numeric Scorer
- Partitioning → Regression Predictor
- Partitioning → Random Forest Learner (Regression)
- Random Forest Learner (Regression) → Random Forest Predictor (Regression)
- Random Forest Predictor (Regression) → Numeric Scorer
- Partitioning → Random Forest Predictor (Regression)
Project files
- CSV datasetCSV11.9 KB
- WEKA ARFF fileWEKA ARFF12.2 KB
- Orange workflow (.ows)Orange5.8 KB
- Data in Orange format (.tab) for the workflowOrange TAB12.0 KB
- Computed reference results (CSV)Results134.0 B
- KNIME workflow (.knwf): ran successfully in the KNIME 5.12 engine (not opened in the interface)KNIME64.5 KB
- Step-by-step implementation guide (PDF)PDF587.5 KB
- Full project package (ZIP)ZIP595.7 KB
The KNIME file (.knwf) was built on KNIME 5.12 and all its nodes ran successfully in the KNIME engine without opening the interface; open it from File → Import KNIME Workflow.
Results
Actual results computed on the attached files
• Linear Regression: MAE 20,712.90, RMSE 26,147.25, R² 0.965
• Decision Tree: MAE 32,930.40, RMSE 41,151.69, R² 0.912
• Random Forest: MAE 23,659.11, RMSE 29,576.34, R² 0.955
And the results of the Orange 3.41.0 library (10-fold, like the default Test and Score settings):
• Linear Regression: MAE 20,761.72, RMSE 26,272.15, R² 0.964
• Tree: MAE 33,034.60, RMSE 40,929.65, R² 0.913
• Random Forest: MAE 25,072.82, RMSE 31,113.13, R² 0.950
Evaluation metrics
- MAE
- RMSE
- R²
Interpreting the results
Linear regression explains about 96% of the variance because the prices were generated with a roughly linear relationship plus noise; in real markets the relationships are more complex and need location and quality features.
Discussion questions
- Why is RMSE always greater than or equal to MAE?
- What does R² = 0.96 mean in practice?
- How do you handle a house outside the range of the training data?
