Class: FSelector::BaseDiscrete

Inherits:
Base
  • Object
show all
Includes:
Discretizer
Defined in:
lib/fselector/algo_base/base_discrete.rb

Overview

base alogrithm for discrete feature

many algos are based on the following 2 x 2 contingency table

      c   c'
    ---------
 f  | A | B | A+B
    |---|---| 
 f' | C | D | C+D
    ---------
     A+C B+D  N = A+B+C+D

 P(f)     = (A+B)/N
 P(f')    = (C+D)/N
 P(c)     = (A+C)/N
 P(c')    = (B+D)/N
 P(f,c)   = A/N
 P(f,c')  = B/N
 P(f',c)  = C/N
 P(f',c') = D/N
 P(f|c)   = A/(A+C)
 P(f|c')  = B/(B+D)
 P(f'|c)  = C/(A+C)
 P(f'|c') = D/(B+D)

Instance Method Summary collapse

Methods included from Discretizer

#discretize_by_Chi2!, #discretize_by_ChiMerge!, #discretize_by_MID!, #discretize_by_TID!, #discretize_by_equal_frequency!, #discretize_by_equal_width!

Methods included from Entropy

#get_conditional_entropy, #get_information_gain, #get_joint_entropy, #get_marginal_entropy, #get_symmetrical_uncertainty

Methods included from Consistency

#get_IR, #get_IR_by_count, #get_IR_by_feature, #get_instance_count

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

#initialize(data = nil) ⇒ BaseDiscrete

initialize from an existing data structure


36
37
38
# File 'lib/fselector/algo_base/base_discrete.rb', line 36

def initialize(data=nil)
  super(data)
end