hfs.HIP¶
- class hfs.HIP(hierarchy=None)[source]¶
Select non-redundant features with the highest relevance following the algorithm proposed by Wan and Freitas.
- __init__(hierarchy=None)[source]¶
Initializes a HIP-Selector.
- Parameters
- hierarchynp.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. The features are selected, so that for each testing instance in each path only the deepest positive or the highest negative feature is preserved.
- Parameters
- predictbool
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.