@gaurav984 wrote:
Hi Team,
I am trying to build and run a logistic regression model (with a very large dataset). After data cleaning, dummy creation and vif check when tried to run the model i am getting below error:
Build logistic regression model (using statsmodels package/library)
import statsmodels.api as sm
M1 = sm.Logit(Train_Y, Train_X) # (Dep_Var, Indep_Vars) # This is model definition
M1_Model = M1.fit() # This is model buildingError:
File “C:\Users\Gaurav Rai\Anaconda3\lib\site-packages\numpy\linalg\linalg.py”, line 528, in inv
ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)File “C:\Users\Gaurav Rai\Anaconda3\lib\site-packages\numpy\linalg\linalg.py”, line 89, in _raise_linalgerror_singular
raise LinAlgError(“Singular matrix”)LinAlgError: Singular matrix
Complete code is attached. Along with below links to datasets:
Initial Dataset: https://drive.google.com/drive/folders/1aclWn4EVlk8LYQxBfNDbDM697GeaddkK?usp=sharing
Code Attachment:
final_project1.zip (3.3 KB)Kindly help me in resolving this issue.
Thanks & Regards,
Gaurav Rai
Posts: 2
Participants: 1