0

I am trying to predict churn of telecom user by logistic regression model, I am getting

ValueError: Pandas data cast to numpy dtype of object. Check input data with 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()
Kos
  • 4,890
  • 9
  • 38
  • 42
Kalyan Mohanty
  • 95
  • 1
  • 10
  • maybe `X = churn_data.drop(['churn_status','Ph_No.'],axis=1).values` and `y = churn_data['churn_status'].values` – Ha Bom Oct 30 '19 at 09:41

0 Answers0