relief

Module: missions.nodes.feature_selection.relief

Feature selection based on the RELIEF algorithm

Inheritance diagram for pySPACE.missions.nodes.feature_selection.relief:

Inheritance diagram of pySPACE.missions.nodes.feature_selection.relief

ReliefFeatureSelectionNode

class pySPACE.missions.nodes.feature_selection.relief.ReliefFeatureSelectionNode(num_retained_features=None, selected_features_path=None, k=1, **kwargs)[source]

Bases: pySPACE.missions.nodes.base_node.BaseNode

Feature selection based on the RELIEF algorithm

Feature selection based on the RELIEF algorithm. A feature is preferred if instances of the same class (hits) are comparatively close to each other compared to instances of the other class (misses) in the feature dimension. Please refer to “Estimating Attributes: Analysis and Extensions of RELIEF” by Kononenko for more information.

Parameters

num_retained_features:
 

The number of features that should be retained by the node. This information must be specified if selected_features_path is not specified.

(optional, default: None)

selected_features_path:
 

An absolute path from which the selected features are loaded. If not specified, these features are learned from the training data. In this case, num_retained_features must be specified.

(optional, default: None)

k:

The number of nearest neighbors that are considered when computing the closest hits and misses. Defaults to 1.

(optional, default: 1)

Exemplary Call

-
    node : ReliefFeatureSelection
    parameters :
          num_retained_features : 100
          k : 10
Author:

Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)

Created:

2010/07/12

POSSIBLE NODE NAMES:
 
  • ReliefFeatureSelection
  • ReliefFeatureSelectionNode
POSSIBLE INPUT TYPES:
 
  • FeatureVector

Class Components Summary

_execute(feature_vector) Projects the feature vector onto the retained features
_search_k_nearest_neighbors(instance, ...)
_stop_training([debug]) Called automatically at the end of training
_train(data, label) Add given data point along with its label to the training set.
input_types
is_supervised() Returns whether this node requires supervised training
is_trainable() Returns whether this node is trainable
store_state(result_dir[, index]) Stores this node in the given directory result_dir
__init__(num_retained_features=None, selected_features_path=None, k=1, **kwargs)[source]
is_trainable()[source]

Returns whether this node is trainable

is_supervised()[source]

Returns whether this node requires supervised training

_train(data, label)[source]

Add given data point along with its label to the training set.

_stop_training(debug=False)[source]

Called automatically at the end of training

Computes a ranking of features and stores a list of the indices of those feature that should be retained

_execute(feature_vector)[source]

Projects the feature vector onto the retained features

_search_k_nearest_neighbors(instance, class_label, k)[source]
input_types = ['FeatureVector']
store_state(result_dir, index=None)[source]

Stores this node in the given directory result_dir