class Mirlo::Sample

Attributes

features[R]
target[R]

Public Class Methods

new(target: [], features: []) click to toggle source
# File lib/mirlo/sample.rb, line 4
def initialize(target: [], features: [])
  @target   = target.is_a?(Array) ? target : [target]
  @features = features
end

Public Instance Methods

==(other_sample) click to toggle source
# File lib/mirlo/sample.rb, line 29
def ==(other_sample)
  target    == other_sample.target &&
  features  == other_sample.features &&
  biased?   == other.biased?
end
[](index) click to toggle source
# File lib/mirlo/sample.rb, line 9
def [](index)
  @features[index]
end
biased?() click to toggle source
# File lib/mirlo/sample.rb, line 25
def biased?
  false
end
feature_size() click to toggle source
# File lib/mirlo/sample.rb, line 17
def feature_size
  features.size
end
has_features?(some_features) click to toggle source
# File lib/mirlo/sample.rb, line 13
def has_features?(some_features)
  features == some_features
end
target_size() click to toggle source
# File lib/mirlo/sample.rb, line 21
def target_size
  target.size
end