Getting LinAlgError: SVD did not converge err in sm.OLS.fit() in the first run only. In the second run, the same code runs without any change in data and code. Already tried out StakeOverFlow solutions - Most likely there are nans in the data, you can add missing='drop' when creating the model sm.OLS(y, X, missing='drop').Another possibility could be problems with dtypes, try to use X.astype(float). But the result is the same. ... Also tried out one more STOFLOW solution df_train = df_train.replace(np.inf, np.nan).replace(-np.inf, np.nan).dropna()... But no improvement... Applying .isnull().sum() is returning 0 both for X, y....It means there are no NaNs in the data....Please advise
Asked
Active
Viewed 1,503 times