Class: Classify3::Bayes
- Inherits:
-
Object
- Object
- Classify3::Bayes
- Defined in:
- lib/classify3/bayes.rb
Instance Method Summary collapse
- #add(doc, label) ⇒ Object
- #classify(str) ⇒ Object
-
#initialize ⇒ Bayes
constructor
A new instance of Bayes.
- #train ⇒ Object
Constructor Details
#initialize ⇒ Bayes
3 4 5 |
# File 'lib/classify3/bayes.rb', line 3 def initialize @rust = Classify3::Rust::Binding.new end |
Instance Method Details
#add(doc, label) ⇒ Object
7 8 9 |
# File 'lib/classify3/bayes.rb', line 7 def add(doc, label) @rust.add(doc, label) end |
#classify(str) ⇒ Object
15 16 17 |
# File 'lib/classify3/bayes.rb', line 15 def classify(str) @rust.classify(str) end |
#train ⇒ Object
11 12 13 |
# File 'lib/classify3/bayes.rb', line 11 def train @rust.train end |