Method: CrossValidation::ConfusionMatrix#precision
- Defined in:
- lib/cross_validation/confusion_matrix.rb
#precision ⇒ Float
Computes the precision of the classifier, defined as tp/(tp + fp)
58 59 60 |
# File 'lib/cross_validation/confusion_matrix.rb', line 58 def precision @values.fetch(:tp) / Float(@values.fetch(:tp) + @values.fetch(:fp)) end |