hfs.RNB

class hfs.RNB(hierarchy=None, k=0)[source]

Select the k features with the highest relevance.

__init__(hierarchy=None, k=0)[source]

Initializes a RNB-Selector.

Parameters
hierarchynp.ndarray

The hierarchy graph as an adjacency matrix.

kint

The numbers of features to select.

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 top-k-ranked features in descending order of their individual predictive power measured by their relevance defined in helpers.py

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.