6/25
Part 2 of 5 · The best θLearn and do

Search θ for the least variance

Try a range of θ\theta on the eight users and print the variance each one leaves, with a bar to show its size:

for theta in [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5]:
    v = (y - theta * (x - x.mean())).var()
    print(f"{theta:.2f}  {'█' * round(8 * v):<36}  {v:.3f}")
Predict

Try θ from 0 to 1.5 on the eight users. Where is the variance lowest?

Pick one to see what it prints.
Pick an answer above to see the rest