Class: HybridForest::Trees::RandomFeatureSubspace

Inherits:
Object
  • Object
show all
Defined in:
lib/hybridforest/trees/feature_selectors/random_feature_subspace.rb

Instance Method Summary collapse

Instance Method Details

#select_features(all_features) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/hybridforest/trees/feature_selectors/random_feature_subspace.rb', line 8

def select_features(all_features)
  # TODO: Allow the subspace size to be configured.
  n = default_subspace_size(all_features.count)
  indices = Set.new
  until indices.size == n
    indices << rand(0...all_features.count)
  end
  all_features.values_at(*indices)
end

#update(_feature) ⇒ Object



18
19
# File 'lib/hybridforest/trees/feature_selectors/random_feature_subspace.rb', line 18

def update(_feature)
end