← All Base Form ML projects
BL-01NOT STARTEDBASE FORM · CLASSICAL MLMLPYTHON

Bike-demand predictor

Predict how many bikes a city's bike-share will rent tomorrow from weather and calendar features.

EST.5 h
REWARD+100 XP
AFTERoriginal

ML-ARENA BENCHMARKS

YOUR NUMBER VS THE INDUSTRY'S
METRICINDUSTRYMINE
test RMSE
GOAL · match within 0.1%; beat the seasonal-average baseline
sklearn LinearRegression—
no results yet
YOUR RESULTS

Your recorded results appear here.

Brief

A bike-share company has to decide how many bikes and staff to put out each morning. Too few and riders walk away. Too many and money sits idle. In this project you predict tomorrow's rental count from the weather and the calendar. This is your first machine-learning model, so the point is to do every step by hand and check it against scikit-learn.

The data is the Bike Sharing dataset from the UCI Machine Learning Repository. It holds two years (2011 and 2012) of daily counts from Capital Bikeshare in Washington, D.C., with weather and calendar columns. Use the file day.csv. You can also load it in Python with the ucimlrepo package.

The model is linear regression. Each prediction is a weighted sum of features: y^=w0+w1x1+⋯+wdxd\hat{y} = w_0 + w_1 x_1 + \dots + w_d x_d, or y^=Xw\hat{y} = Xw for all days at once. The best weights minimise the squared error and solve the normal equations X⊤Xw=X⊤yX^\top X w = X^\top y. Ridge regression adds a penalty λ∥w∥2\lambda \lVert w \rVert^2 that keeps weights small, which changes the system to (X⊤X+λI)w=X⊤y(X^\top X + \lambda I) w = X^\top y. You score the model with RMSE=1n∑i(yi−y^i)2\text{RMSE} = \sqrt{\tfrac{1}{n} \sum_i (y_i - \hat{y}_i)^2}.

Two habits start here and last the whole track. First, split by time: you are predicting the future, so the test days must come after the training days. Second, always build a dumb baseline first. If your model can't beat "the average for this season", it hasn't learned anything useful.

VISUALFig. 1
FIT WEIGHTSTrainJan 2011 to Mar 2012 TUNE λValApr to Jun SCORE ONCETestJul to Dec 2012 1 Jan 2011 1 Jan 2012 31 Dec 2012 TIME →
Train on the past, tune on the end of the past, test once on the future. Why it's here: A random split lets the model peek at days next to the test days. This shows the split objective 1 asks for.
HINT · OBJECTIVE 1
Stuck? Hints stay hidden until you ask.
HINT · OBJECTIVE 4
Stuck? Hints stay hidden until you ask.

DATA · UCI Bike Sharing

Objectives

0 / 6 CLEARED

Read-only. Log in to update progress.

VICTORY CONDITIONS

  1. Your from-scratch model's test RMSE is within 0.1% of sklearn LinearRegression on the same features, and below the seasonal-average baseline. Record it with `python tools/mlarena.py record BL-01 "<your RMSE>"`.
  2. The test period comes strictly after the training period, and casual and registered are not features.
  3. The README shows a predicted-versus-actual plot for the test days and lists the five largest weights with a sentence on each.

Side quests

Switch to hour.csv and add hour-of-day features. See how much the RMSE drops and which hours your model gets most wrong.
Fit the model with gradient descent instead of the normal equations and plot the loss falling toward the closed-form answer.

Terms in plain words

Linear regression
A model that predicts a number as a weighted sum of the input features plus a constant.
Feature engineering
Turning raw columns into inputs a model can use, such as splitting "season" into four yes/no columns.
One-hot encoding
Replacing a category with one 0/1 column per value, so the model doesn't treat "season 4" as twice "season 2".
RMSE
Root mean squared error. The typical size of a prediction miss, in the same units as the target (bikes per day).
Test set
Data you hide from training and use once at the end, so the score tells you how the model does on days it has never seen.