logml.report.controllers.feature_importance

Functions

generate_similarity_table(rank_df[, ...])

Calculate symmetrical matrix [n_strata, n_strata] with values equal to kendal tau rank metrics, e.g.

Classes

CrossStrataFIController(cfg, global_params)

Implements data handling and plotting API for cross-strata FI comparison.

FIDSController(cfg, global_params[, ...])

Implements data handling and plotting API for FeatureImportance results.

FeatureImportanceController(cfg, global_params)

Implements data handling and plotting API for FeatureImportance results.

class logml.report.controllers.feature_importance.FeatureImportanceController(cfg: GlobalConfig, global_params: dict, setup_id: str = '', logger=None)

Bases: object

Implements data handling and plotting API for FeatureImportance results.

static read_feature_importance_artifact(filepath: pathlib.Path)

Simple reader for FI summaries in csv format.

property dataframe: pandas.core.frame.DataFrame

Returns preprocessed dataframe.

show_problem_statement()

Displays a static table with details of problem statement, task, metrics, etc.

load_raw_summary() pandas.core.frame.DataFrame

Returns FI summary (raw): all methods used concatenated.

load_ranked_summary() pandas.core.frame.DataFrame

Returns FI summary: all methods used concatenated.

show_fi_methods_overview()

Displays a list of FI methods used.

show_global_fi_overview()

Displays the averaged featured ranking.

show_complete_fi_summary()

Shows a heatmap for all methods and features.

select_top_features() List[str]

Returns a list of features that appeared at the topK at least once.

select_vardict_mut_features() List[str]

Returns a list of Vardict features with Mutations.

check_top_features() bool

Checks whether it makes sense to create a separate plot for the top features.

check_vardict_mut_features() bool

Checks whether it makes sense to create a separate plot for Vardict Mut features.

show_fi_for_top_features()

Shows the result importances only for the TopK features.

show_fi_for_vardict_mut_features()

Shows the result importances only for the Vardict Mut features.

get_bootstrapped_models() List[str]

Returns a list of models for which bootstrapping results are available.

show_bootstrapping_result(model_alias: str)

Produces visualizations for a given model.

show_association_with_target()

Shows additional plots for associating features with target.

class logml.report.controllers.feature_importance.FIDSController(cfg: GlobalConfig, global_params: dict, setup_id: str = '', logger=None)

Bases: object

Implements data handling and plotting API for FeatureImportance results.

plot_summary_table()
static read_feature_importance_artifact(filepath: pathlib.Path)

Simple reader for FI summaries in csv format.

property dataframe: pandas.core.frame.DataFrame

Returns preprocessed dataframe.

show_problem_statement()

Displays a static table with details of problem statement, task, metrics, etc.

class logml.report.controllers.feature_importance.CrossStrataFIController(cfg: GlobalConfig, global_params: dict)

Bases: object

Implements data handling and plotting API for cross-strata FI comparison.

get_strata_cross_product() List[Tuple[str, str]]

Returns a list of (strata_id_i, strata_id_j) combinations.

show_strata_overview()

Displays a list of available stratas.

show_all_strata_comparison_heatmap(horizontal_heatmap=True)

Shows a summary with averaged FI ranks across stratas.

show_two_strata_comparison_scatter()

Displays a scatter with averaged FI rankings for all pairs of strata.

plot_all_ranks_similarity(top_features=None, labels=None, plots_per_row=3, row_height: int = 6, col_width: int = 6)

Plot rank similarity matrices for set of features.

plot_all_ranks_clustermap(n_top_features=50)

Plot clustermap for 1-based ranks for all strata

logml.report.controllers.feature_importance.generate_similarity_table(rank_df, n_top_features=- 1, method='weighted')

Calculate symmetrical matrix [n_strata, n_strata] with values equal to kendal tau rank metrics, e.g. how similar are ranks for two given strata