henchman.selection.Dendrogram

class henchman.selection.Dendrogram(X=None, pairing_func=None, max_threshes=None)[source]

Pair features by an arbitrary function. Creates a dendrogram which is a set of graphs representing connectivity at a set of discrete thresholds.

__init__(X=None, pairing_func=None, max_threshes=None)[source]

An object to store graphs for a given pairing function. If given a dataframe X this first creates an adjacency matrix given a certain pairing function. It will then go through and build endges and graphs from those edge-vertex pairs. The graphs are all stored in order.

Parameters:
  • X (pd.DataFrame) – The dataframe for which to build the Dendrogram.
  • pairing_func (func) – A function which takes in two columns and returns a number.
  • max_threshes (int) – The maximum number of graphs to build.

Methods

__init__([X, pairing_func, max_threshes]) An object to store graphs for a given pairing function.
features_at_step(step) Find the representatives at a certain step for a given graph.
find_set_of_size(size) Finds a column set of a certain size in the Dendrogram.
fit(X[, pairing_func, max_threshes]) Build graphs for a given pairing function.
score_at_point(X, y, model, metric, step[, …]) A helper method for scoring a Dendrogram at a step.
set_params(**params) Method to functionally assign parameters.
shuffle_all_representatives() Shuffle representatives for every graph in D.graphs.
shuffle_score_at_point(X, y, model, metric, step) A helper method for scoring a Dendrogram at a step.
transform(X[, n_feats]) Return a dataframe of a particular size.