Generalized Linear Models ใน Python
Ita Cirovic Donev
Data Science Consultant
Yes, Nored, green, blueEducation1, Education2,...,Education4ตัวแปรอธิบาย
โมเดล Logistic $$ \text{logit}(y=1|X)=\beta_0 + \beta_1x_1 + \beta_2x_2 $$
โมเดล Logistic $$ \text{logit}(y=1|X)=\beta_0 + \beta_1\color{red}{x_1} + \beta_2x_2 $$
ถ้า $x_1=0$ แล้ว $$ \text{logit}(y=1|\color{red}{x_1=0},x_2)=\beta_0 + \color{red}{0} + \beta_2x_2 $$
โมเดล Logistic $$ \text{logit}(y=1|X)=\beta_0 + \beta_1\color{red}{x_1} + \beta_2x_2 $$
ถ้า $x_1=0$ แล้ว $$ \text{logit}(y=1|x_1=0,x_2)=\beta_0 + 0 + \beta_2x_2 $$
ถ้า $x_1 = 1$ แล้ว $$ \text{logit}(y=1|\color{red}{x_1=1},x_2)=\beta_0 + \color{red}{\beta_1} + \beta_2x_2 $$ $$ \text{logit}(y=1|\color{red}{x_1=1},x_2)=(\beta_0 + \color{red}{\beta_1}) + \beta_2x_2 $$




โมเดล Logistic ที่รองรับปฏิสัมพันธ์ $$ \text{logit}(y=1|X)=\beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 $$
ถ้า $x_1=0$ แล้ว $$ \text{logit}(y=1|\color{red}{x_1=0},x_2)=\beta_0 + \color{red}{0} + \beta_2x_2 + \color{red}{0} $$
โมเดล Logistic ที่รองรับปฏิสัมพันธ์ $$ \text{logit}(y=1|X)=\beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 $$
ถ้า $x_1=0$ แล้ว $$ \text{logit}(y=1|x_1=0,x_2)=\beta_0 + \beta_2x_2 $$
ถ้า $x_1 = 1$ แล้ว $$ \text{logit}(y=1|\color{red}{x_1=1},x_2)=\beta_0 + \color{red}{\beta_1} + \beta_2x_2 + \color{red}{\beta_3}x_2 $$ $$ \text{logit}(y=1|\color{red}{x_1=1},x_2)=(\beta_0 + \color{red}{\beta_1}) + (\beta_2 + \color{red}{\beta_3})x_2 $$
โมเดล Logistic ที่รองรับปฏิสัมพันธ์ $$ \text{logit}(y=1|X)=\beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 $$
ถ้า $x_1=0$ แล้ว $$ \text{logit}(y=1|x_1=0,x_2)=\color{red}{\beta_0} + \color{red}{\beta_2}x_2 $$
ถ้า $x_1 = 1$ แล้ว $$ \text{logit}(y=1|x_1=1,x_2)=\beta_0 + \beta_1 + \beta_2x_2 + \beta_3x_2 $$ $$ \text{logit}(y=1|x_1=1,x_2)=\color{red}{(\beta_0 + \beta_1)} + \color{red}{(\beta_2 + \beta_3)}x_2 $$

ปฏิสัมพันธ์ทำให้:
Generalized Linear Models ใน Python