auswahl.optimize_intervals¶
- auswahl.optimize_intervals(n_intervals: int, interval_width: int, feature_scores: array)[source]¶
The algorithm calculates the optimal non-overlapping placement of n_intervals of width interval_width into the range of features. The feature scores are specified in feature_scores (greater better). The algorithm can be used for instance to turn every point selection algorithm yielding a score for each feature (such as
VIP) into an interval selection algorithm. The runtime of the algorithm is
, with
k being n_intervals and n feature_scores.size- Parameters
- n_intervals: int
Number of intervals to be placed.
- interval_width: int
Width of the intervals.
- feature_scores: np.array of shape (n, )
Array of scores of variables (greater better).
- Returns
- tuple: (float, List[int])
Tuple of overall score of the interval placement, list of interval starts.