lib/libsvm/node.rb in rb-libsvm-1.3.0 vs lib/libsvm/node.rb in rb-libsvm-1.3.1
- old
+ new
@@ -1,7 +1,7 @@
module Libsvm
- # Represents a feature
+ # This class represents a feature.
#
# A feature has an index and a value.
#
# An array of features (Libsvm::Node instances) represents an
# example which can be classified, or in greater number can
@@ -75,14 +75,14 @@
new(index, value)
end
end
# @!attribute index
- # The index identifies the feature for which this node represents a value
+ # The index identifies the feature for which this node represents a value.
# @!attribute value
- # The value of this feature in this instance
+ # The value of this feature in this instance.
# Create a new feature node.
#
# Libsvm::Node.new(0, 1.1) # => #<Libsvm::Node: index=0, value=1.1>
def initialize(index=0, value=0.0)
@@ -97,10 +97,10 @@
# @return [Boolean]
def ==(other)
index == other.index && value == other.value
end
- def inspect # :nodoc:
+ def inspect
vars = %w(index value).map { |name|
"#{name}=#{send(name)}"
}.join(", ")
"#<#{self.class}: #{vars}>"
end