Neuron 101

Classification / Logistic regression

Türkçe

Plate33

Unit 4 · Topic 1 of 10

Logistic regression

Medium, 8 min, 8 steps

81216202428323600.250.500.751temperature, degreeschance of selling out
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 8 Days

Sold out or not

The ice cream seller's 16 days. The red circles are days when the ice cream sold out by evening, at the top, 1. The blue squares are days when it did not, at the bottom, 0. We now predict a class, not a number.

Open in Colab
  1. import math
  2. def sigmoid(z):
  3. return 1 / (1 + math.exp(-z))
  4. w, b = 0.3, -6.6
  5. x = 25.0
  6. p = sigmoid(w * x + b)
  7. tukenir = p >= 0.5
  8. print(p, tukenir)
w
0.30
b
−6.60
p
0.71
sinif
1