hfs.Tan

class hfs.Tan(hierarchy=None)[source]

Select non-redundant features following the algorithm proposed by Wan and Freitas.

__init__(hierarchy=None)[source]

Initializes a HNBs-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. It builds a minimal spanning tree (MST), by first adding all possible edges, that meets certain conditions (to remove redundancy and selecting most relevant features) to an undirected graph (UDAG). Afterwards features are obtained from the tree and can be used for prediction.

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.

Examples using hfs.Tan

Lazy learning

Lazy learning