henchman.selection.Dendrogram.shuffle_score_at_point¶
-
Dendrogram.
shuffle_score_at_point
(X, y, model, metric, step, n_splits=1)[source]¶ A helper method for scoring a Dendrogram at a step. This method shuffles the graph representatives and then runs
score_at_point
. By running shuffle and score at point multiple times, you can get an impression of how representative a particular feature set is of the underlying graph structure.Parameters: - X (pd.DataFrame) – A dataframe with the same columns that the Dendrogram was built with.
- y (pd.Series) – Labels for X.
- model – A sklearn model with fit and predict methods.
- metric – A metric which takes y_test, preds and returns a score.
- step (int) – Which position in self.threshlist to show features from.
- n_splits (int) – If 1 use a train_test_split. Otherwise use tssplit. Default value is 1.