Python으로 배우는 Generalized Linear Models
Ita Cirovic Donev
Data Science Consultant
Yes, Nored, green, blueEducation1, Education2,...,Education4설명 변수
로지스틱 모형 $$ \text{logit}(y=1|X)=\beta_0 + \beta_1x_1 + \beta_2x_2 $$
로지스틱 모형 $$ \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 $$
로지스틱 모형 $$ \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 $$




상호작용을 허용하는 로지스틱 모형 $$ \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} $$
상호작용을 허용하는 로지스틱 모형 $$ \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 $$
상호작용을 허용하는 로지스틱 모형 $$ \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 $$

상호작용은 다음을 허용:
Python으로 배우는 Generalized Linear Models