Class: Inferx::Category::Complementary
- Inherits:
-
Inferx::Category
- Object
- Inferx::Category
- Inferx::Category::Complementary
- Defined in:
- lib/inferx/category/complementary.rb
Instance Attribute Summary
Attributes inherited from Inferx::Category
Instance Method Summary collapse
-
#eject ⇒ Object
Eject the words from the training data of the category.
-
#inject ⇒ Object
Inject the words to the training data of the category.
-
#train(words) ⇒ Object
Enhance the training data of other categories giving words.
-
#untrain(words) ⇒ Object
Attenuate the training data of other categories giving words.
Methods inherited from Inferx::Category
#all, #get, #initialize, ready_for, #scores
Constructor Details
This class inherits a constructor from Inferx::Category
Instance Method Details
#eject ⇒ Object
Eject the words from the training data of the category.
23 |
# File 'lib/inferx/category/complementary.rb', line 23 alias eject untrain |
#inject ⇒ Object
Inject the words to the training data of the category.
10 |
# File 'lib/inferx/category/complementary.rb', line 10 alias inject train |
#train(words) ⇒ Object
Enhance the training data of other categories giving words.
36 37 38 |
# File 'lib/inferx/category/complementary.rb', line 36 def train(words) @categories.except(@name).inject(words) end |
#untrain(words) ⇒ Object
Attenuate the training data of other categories giving words.
43 44 45 |
# File 'lib/inferx/category/complementary.rb', line 43 def untrain(words) @categories.except(@name).eject(words) end |