Diagnostics
Variance inflation factor calculation.
featurely.diagnostics
compute_vif(df, cols)
Compute variance inflation factors for the selected columns.
VIF measures how much a coefficient's variance is inflated by collinearity with the other columns; values above roughly 10 signal problematic redundancy. Columns whose VIF cannot be computed are reported as infinity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Input frame. NaNs are filled with 0 before computation. |
required |
cols
|
list[str]
|
Columns to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
A frame with |
Source code in src/featurely/diagnostics.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |