Class: FSelector::BaseReliefF

Inherits:
Base
  • Object
show all
Defined in:
lib/fselector/algo_base/base_ReliefF.rb

Overview

Note:

applicable to multi-class problem with missing data

base class for extended Relief algorithm (ReliefF), see specialized versions for discrete feature (ReliefF_d) and continuous feature (ReliefF_c), respectively

ref: Estimating Attributes: Analysis and Extensions of RELIEF

Direct Known Subclasses

ReliefF_c, ReliefF_d

Instance Method Summary (collapse)

Methods inherited from Base

#algo_type, #each_class, #each_feature, #each_sample, #get_class_labels, #get_classes, #get_data, #get_data_copy, #get_feature_ranks, #get_feature_scores, #get_feature_type, #get_feature_values, #get_features, #get_opt, #get_sample_size, #select_feature!, #select_feature_by_rank!, #select_feature_by_score!, #set_classes, #set_data, #set_feature_type, #set_features, #set_opt

Methods included from ReplaceMissingValues

#replace_by_fixed_value!, #replace_by_knn_value!, #replace_by_mean_value!, #replace_by_median_value!, #replace_by_most_seen_value!

Methods included from FileIO

#data_from_csv, #data_from_libsvm, #data_from_random, #data_from_url, #data_from_weka, #data_to_csv, #data_to_libsvm, #data_to_weka

Constructor Details

- (BaseReliefF) initialize(m = 30, k = 10, data = nil)

intialize from an existing data structure

Parameters:

  • m (Integer) (defaults to: 30)

    number of samples to be used for estimating feature contribution. max can be the number of training samples

  • k (Integer) (defaults to: 10)

    number of k-nearest neighbors



22
23
24
25
26
27
# File 'lib/fselector/algo_base/base_ReliefF.rb', line 22

def initialize(m=30, k=10, data=nil)
  super(data)
  
  @m = m || 30 # default 30
  @k = k || 10 # default 10
end