Back to Labs

Predict California Home Prices

Guided regression project · 20 steps · Linear regression · random forest

About

Build and compare two regression models end-to-end in your browser. No install needed.

Data

Loaded from scikit-learn via fetch_california_housing. Target is median house value in $100k units.

Task

Complete TODOs top-to-bottom. Use hints first. Switch to Sample solution only when stuck.


Sign in to run cells and save progress. Log in or sign up.

Cell 1

Step 1: Imports

Cell 2

Step 2: Load sklearn dataset

Cell 3

Step 3: Shape

Cell 4

Step 4: Head

Cell 5

Step 5: Summary stats

Cell 6

Step 6: Target histogram

Cell 7

Step 7: Target cap

Cell 8

Step 8: Scatter (MedInc)

Cell 9

Step 9: Scatter (AveRooms)

Cell 10

Step 10: Scatter (HouseAge)

Cell 11

Step 11: Correlations

Cell 12

Step 12: Train/test split

Cell 13

Step 13: Fit linear model

Cell 14

Step 14: Linear RMSE

Cell 15

Step 15: Linear actual vs predicted

Cell 16

Step 16: Linear residuals

Cell 17

Step 17: Fit random forest

Cell 18

Step 18: Compare RMSE

Cell 19

Step 19: RF actual vs predicted

Cell 20

Step 20: RF feature importance