drop_one_var_contribution#
- drop_one_var_contribution(df, x_cols, y_col, method='newton')[source]#
Calculate the contribution of each variable in a logistic regression model by dropping one variable at a time and measuring the change in R^2. :param df: DataFrame containing the data. :type df: pd.DataFrame :param x_cols: List of independent variable column names. :type x_cols: list :param y_col: Dependent variable column name. :type y_col: str :param method: Optimization method for fitting the model. :type method: str
- Returns:
Normalized contributions of each variable.
- Return type:
pd.Series