Použití modelu logistické regrese

Introduction to Predictive Analytics in Python

Nele Verbiest, Ph.D

Data Scientist @PythonPredictions

Funkce logistické regrese

0.545 * gender_F 
+ 0.021 * age 
-0.001 * time_since_last_gift 
-3.39
  • Žena (gender_F=1)
  • Věk 72
  • 120 dní od posledního daru
0.545 * 1 
+ 0.021 * 72 
-0.001 * 120 
-3.39 
= -1.45

$\frac{1}{1+e^{-(-1.45)}} = 0.19$

Introduction to Predictive Analytics in Python

Předpovědi v Pythonu

  • Žena (gender_F=1)
  • Věk 72
  • 120 dní od posledního daru
logreg.predict_proba([1, 72, 120])
array([[ 0.8204144,  0.1795856]])
Introduction to Predictive Analytics in Python

Předpovědi v Pythonu

new_data = current_data[["gender_F","age","time_since_last_gift"]]

predictions = logreg.predict_proba(new_data)
Introduction to Predictive Analytics in Python

Pojďme si procvičit!

Introduction to Predictive Analytics in Python

Preparing Video For Download...