1
나는 파이썬 통계 모델의 적합한 로지스틱 회귀 모델로부터 어떻게 확률 비율을 얻을 수 있는지 궁금합니다.statsmodels 로지스틱 회귀 오즈 비율
>>> import statsmodels.api as sm
>>> import numpy as np
>>> X = np.random.normal(0, 1, (100, 3))
>>> y = np.random.choice([0, 1], 100)
>>> res = sm.Logit(y, X).fit()
Optimization terminated successfully.
Current function value: 0.683158
Iterations 4
>>> res.summary()
<class 'statsmodels.iolib.summary.Summary'>
"""
Logit Regression Results
==============================================================================
Dep. Variable: y No. Observations: 100
Model: Logit Df Residuals: 97
Method: MLE Df Model: 2
Date: Sun, 05 Jun 2016 Pseudo R-squ.: 0.009835
Time: 23:25:06 Log-Likelihood: -68.316
converged: True LL-Null: -68.994
LLR p-value: 0.5073
==============================================================================
coef std err z P>|z| [95.0% Conf. Int.]
------------------------------------------------------------------------------
x1 -0.0033 0.181 -0.018 0.985 -0.359 0.352
x2 0.0565 0.213 0.265 0.791 -0.362 0.475
x3 0.2985 0.216 1.380 0.168 -0.125 0.723
==============================================================================
"""
>>>
여기에있는 정보 : http://blog.yhat.com/posts/logistic-regression-and-python.html – BrenBarn
사이트 'OR = np.exp (res.params)'에 따르면. 나는 그 공식이 맞다는 것을 100 % 확신하지 못합니다. – Donbeo
확률 비율을 얻는 방법에 대한 질문이나 통계 모델로부터 얻는 방법에 관한 질문입니다. 예를 들어 [이 페이지]의 마지막 부분 (http://www.ats.ucla.edu/stat/stata/faq/oratio.htm)을 보면 다음과 같이 말합니다. "모든 수학적 조작의 최종 결과는 확률 비율은 로지스틱 계수의 지수로 e를 올려 계산할 수있다. " – BrenBarn