Результаты GLM, возвращающие отклонение = nan - PullRequest
0 голосов
/ 28 июня 2019

Сводные результаты Python GLM, возвращающие значение отклонения от Nan

Я новичок в Python и науке о данных. Я использую обобщенную линейную модель в Jupyter. Результаты GLM показывают значение отклонения нан. Это также влияет на AIC.

Модель имеет сочетание категориальных (~ 25) и непрерывных (6) переменных.

#Assign the dataframe to the X variable and drop the response variable "fully_funded"
X = p2o_mstr_df6.drop("fully_funded",axis=1)

X = sm.add_constant(X)

Y = p2o_mstr_df6["fully_funded"]

# all Y variables are 1 or 0 and dtype = int64

#Fit the logistic regression for the dataset
logit = sm.GLM(Y, X, family=sm.families.Binomial())

result = logit.fit()

print(result.summary())

np.exp(result.params)

Я не уверен, как решить проблему Deviance = nan. Я пытаюсь улучшить результаты модели, но мне нужно сравнить Deviance и AIC на последующих итерациях.

Generalized Linear Model Regression Results                  
==============================================================================
Dep. Variable:           fully_funded   No. Observations:               131329
Model:                            GLM   Df Residuals:                   131298
Model Family:                Binomial   Df Model:                           30
Link Function:                  logit   Scale:                          1.0000
Method:                          IRLS   Log-Likelihood:                    nan
Date:                Fri, 28 Jun 2019   Deviance:                          nan
Time:                        12:45:53   Pearson chi2:                 9.01e+15
No. Iterations:                   100   Covariance Type:             nonrobust
==============================================================================
...