0

Trying to fit an OLS model but not successful. 2 responses were gotten as error:

  • missingdataerror: exog contains inf or nan
  • olsmodel1 not defined Below is my code: olsmodel1 =sm.OLS(y_train, x_train).fit() print(olsmodel1.summary())

I have checked for missing values using : df1.isna().sum()

Here is the output:

brand_name               0
os                       0
screen_size              0
4g                       0
5g                       0
main_camera_mp           0
selfie_camera_mp         0
int_memory               0
ram                      0
battery                  0
weight                   0
release_year             0
days_used                0
normalized_used_price    0
normalized_new_price     0

I will appreciate of someone can help me out. Thank you

I was actually expecting the OLS result to be generated

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 07 '22 at 11:18
  • I need to fit a regression model using the code: olsmodel1 =sm.OLS(y_train, X_train).fit() ## Complete the code to fit OLS model print(olsmodel1.summary()) Unfortunately I am having error – Foluso Alabi Dec 07 '22 at 18:28

0 Answers0