BPt.EvalResultsSubset.get_fis#

EvalResultsSubset.get_fis(mean=False, abs=False)[source]#

This method will return a pandas DataFrame with each row a fold, and each column a feature if the underlying model supported either the coef_ or feature_importance_ parameters.

In the case that the underlying feature importances or coefs_ are not flat, e.g., in the case of a one versus rest categorical model, then a list multiple DataFrames will be returned, one for each class. The order of the list will correspond to the order of classes.

Parameters
meanbool, optional

If True, return the mean value across evaluation folds as a pandas Series. Any features with a mean value of 0 will also be excluded. Otherwise, if default of False, return raw values for each fold as a Dataframe.

default = False
absbool, optional

If the feature importances should be absolute values or not.

default = False
Returns
fispandas DataFrame or Series

Assuming mean=False, the a pandas DataFrame where each row contains the feature importances from an evaluation fold (unless the underlying feature importances are categorical, in which a list of DataFrames will be returned.)

If mean=True, then a pandas Series (or in the case of underlying categorical feature importances, list of) will be returned, with the mean value from each fold and all features with a value of 0 excluded.

Note: To get the mean values without zero’s excluded, just call .mean() on the result of this method with mean=False.