susanli2016/Machine-Learning-with-Python

Logistic regression

eysdevteam opened this issue · 2 comments

Hi, in have a problem with the implementation of lr
when i try it...
logit_model=sm.Logit(y,X)
i get it...
ValueError: Pandas data cast to numpy dtype of object. Check input data with np.asarray(data)

Firstly, you have to fit that to a stasmodel like:

est = sm.OLS(y, X).fit()

It throws:

Pandas datacast to numpy dtype of object. Check input data with np.asarray(data).

I converted all the dtypes of the DataFrame using

df.convert_objects(convert_numeric=True)

After this, all dtypes of data frame variables appear as int32 or int64. But in the end it still shows dtype: object

can you send me the sample....so I can recreate the problem....