我正在尝试通过逻辑回归模型预测电信用户的流失,我得到
ValueError:Pandas 数据转换为对象的 numpy dtype。使用 np.asarray(data) 检查输入数据。
# Putting feature variable to X
X = churn_data.drop(['churn_status','Ph_No.'],axis=1)
# Putting response variable to y
y = churn_data['churn_status']
X_train, X_test, y_train, y_test = train_test_split(X,y, train_size=0.7,test_size=0.3,random_state=100)
logm1 = sm.GLM(y_train,(sm.add_constant(X_train)), family = sm.families.Binomial())
logm1.fit().summary()