hfs.HNBs¶
- class hfs.HNBs(hierarchy=None)[source]¶
Select non-redundant features following the algorithm proposed by Wan and Freitas.
- __init__(hierarchy=None)[source]¶
Initializes a HNBs-Selector.
- Parameters
- hierarchy: np.ndarray
The hierarchy graph as an adjacency matrix.
- select_and_predict(predict=True, saveFeatures=False, estimator=BernoulliNB())[source]¶
Select features lazy for each test instance amd optionally predict target value of test instances. It selects the features, such that redundancy along each path is removed. Parameters ———- predict : bool
true if predictions shall be obtained.
- saveFeaturesbool
true if features selected for each test instance shall be saved.
- estimatorsklearn-compatible estimator
Estimator to use for predictions.
- Returns
- predictions for test input samples, if predict = false, returns empty array.