lib/nbayes.rb
# Be carefull with this function:
# * It decrement the number of examples for the category.
#   If the being-untrained category has no more examples, it is removed from the category list.
# * It untrain already trained tokens, non existing tokens are not considered.
Be carefull with this function:
It decrement the number of examples for the category.
If the being-untrained category has no more examples, it is removed from the category list.
It untrain already trained tokens, non existing tokens are not considered.
Be carefull with this function : It decrement the number of examples for the category . If the being - untrained category has no more examples it is removed from the category list . It untrain already trained tokens non existing tokens are not considered .
def untrain(tokens, category)
      tokens = tokens.uniq if binarized
      data.decrement_examples(category)
      tokens.each do |token|
        if data.token_trained?(token, category)
          vocab.delete(token)
          data.remove_token_from_category(category, token)
        end
      end
    end
def untrain ( tokens , category ) tokens = tokens . uniq if binarized data . decrement_examples ( category ) tokens . each do | token | if data . token_trained? ( token , category ) vocab . delete ( token ) data . remove_token_from_category ( category , token ) end end end
Be carefull with this function:
 It decrement the number of examples for the category.
Be carefull with this function : It decrement the number of examples for the category .
tokens
<not_specific>
category
<not_specific>