Import statsmodels:
1 |
|
Ordinary Least Squares
Fit OLS:
1 |
|
Summarize the regression results:
1 |
|
1 |
|
Forward variable selection
1 |
|
Leverage statistics
High-leverage points are those observations, if any, made at extreme or outlying values of the independent variables such that the lack of neighboring observations means that the fitted regression model will pass close to that particular observation.
In the linear regression model, the leverage score for the i
-th observation is defined as:
the i
-th diagonal element of the projection matrix $H$ where
1 |
|
As leverage is independent of label vector y
, on can instead do the following:
1 |
|
Variance inflation factor (VIF) for multicollinearity
1 |
|
Visualize long table (of vif) in Jupyter notebook:
1 |
|
Logistic Regression
Fit logistic regression:
1 |
|
Check all available output which is dependent on the solver:
1 |
|
Summarize the regression results:
1 |
|
1 |
|
1 |
|
1 |
|
Test classification performance:
1 |
|
Regularized Logistic Regression
Fit regularized logistic regression:
1 |
|
Summarize the regression results:
1 |
|