Class: Ai4r::Classifiers::NaiveBayes::DataEntry
- Inherits:
-
Object
- Object
- Ai4r::Classifiers::NaiveBayes::DataEntry
- Defined in:
- lib/ai4r/classifiers/naive_bayes.rb
Overview
DataEntry stores the instance of the data entry the data is accessible via entries stores the class-column in the attribute klass and removes the column for the class-entry
Instance Attribute Summary collapse
-
#entries ⇒ Object
Returns the value of attribute entries.
-
#klass ⇒ Object
Returns the value of attribute klass.
Instance Method Summary collapse
-
#[](index) ⇒ Object
wrapper method for the access to @entries.
- #initialize(attributes, klass) ⇒ Object constructor
Constructor Details
#initialize(attributes, klass) ⇒ Object
315 316 317 318 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 315 def initialize(attributes, klass) @klass = klass @entries = attributes end |
Instance Attribute Details
#entries ⇒ Object
Returns the value of attribute entries.
310 311 312 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 310 def entries @entries end |
#klass ⇒ Object
Returns the value of attribute klass.
310 311 312 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 310 def klass @klass end |
Instance Method Details
#[](index) ⇒ Object
wrapper method for the access to @entries
323 324 325 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 323 def [](index) @entries[index] end |