Neuron 101

Learning from examples / Linear regression

Türkçe

Plate24

Unit 3 · Topic 3 of 11

Linear regression

Easy, 7 min, 8 steps

05101520253035010203040506070temperature, degreesice creams sold
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 8 Data

Eight days

The ice cream seller's eight days: temperature across, ice creams sold up. The goal is a line that passes close to these dots.

Open in Colab
  1. w = 1.2
  2. b = 10.0
  3. def tahmin(x):
  4. return w * x + b
  5. x = [12, 15, 18, 20, 23, 26, 29, 32]
  6. y = [25, 26, 35, 33, 42, 48, 48, 56]
  7. i = 6 - 1
  8. print(tahmin(x[i]), y[i])
  9. print(tahmin(27))
w
1.20
b
10
x
26
tahmin
41.20