node.rb 535 B

1234567891011121314151617181920212223242526272829303132
  1. # This file is part of svm_toolkit.
  2. #
  3. # Author:: Peter Lane
  4. # Copyright:: Copyright 2011-13, Peter Lane.
  5. # License:: MIT License
  6. #
  7. module SvmToolkit
  8. #
  9. # Node is used to store the index/value pair for an individual
  10. # feature of an instance.
  11. #
  12. class Node
  13. # :attr_accessor: index
  14. # Index of this node in feature set.
  15. # :attr_accessor: value
  16. # Value of this node in feature set.
  17. #
  18. def initialize(index, value)
  19. super()
  20. self.index = index
  21. self.value = value
  22. end
  23. end
  24. end