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) ⇒ DataEntry
constructor
A new instance of DataEntry.
Constructor Details
#initialize(attributes, klass) ⇒ DataEntry
Returns a new instance of DataEntry.
250 251 252 253 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 250 def initialize(attributes, klass) @klass = klass @entries = attributes end |
Instance Attribute Details
#entries ⇒ Object
Returns the value of attribute entries.
248 249 250 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 248 def entries @entries end |
#klass ⇒ Object
Returns the value of attribute klass.
248 249 250 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 248 def klass @klass end |
Instance Method Details
#[](index) ⇒ Object
wrapper method for the access to @entries
256 257 258 |
# File 'lib/ai4r/classifiers/naive_bayes.rb', line 256 def [](index) @entries[index] end |