peal.sparse_dictionaries.utils.select_dictionary_components

peal.sparse_dictionaries.utils.select_dictionary_components(sparse_dictionary, explainer_config, num_attempts)[source]

Return (W, selected): the dictionary columns the counterfactual attempts steer along.

W has shape [Dim, num_attempts]; selected is the list of column indices. If explainer_config.component_indices is set, attempt k uses column component_indices[k]. Otherwise attempt k uses column k, which is the original behaviour (get_components()[:, :num_attempts]).