Class: Eps::NaiveBayes

Inherits:
BaseEstimator show all
Defined in:
lib/eps/naive_bayes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseEstimator

#evaluate, #initialize, load_pmml, #predict, #predict_probability, #summary, #to_pmml

Constructor Details

This class inherits a constructor from Eps::BaseEstimator

Instance Attribute Details

#probabilitiesObject (readonly)

Returns the value of attribute probabilities.



3
4
5
# File 'lib/eps/naive_bayes.rb', line 3

def probabilities
  @probabilities
end

Instance Method Details

#accuracyObject



5
6
7
# File 'lib/eps/naive_bayes.rb', line 5

def accuracy
  Eps::Metrics.accuracy(@train_set.label, predict(@train_set), weight: @train_set.weight)
end