lib/stamina/classifier.rb in stamina-0.3.0 vs lib/stamina/classifier.rb in stamina-0.3.1
- old
+ new
@@ -18,10 +18,25 @@
sample.each do |str|
signature << label_of(str)
end
signature
end
+ alias :classification_signature :signature
+
+ #
+ # Classifies a sample then compute the classification scoring that is obtained
+ # by comparing the signature obtained by classification and the one of the sample
+ # itself. Returns an object responding to methods defined in Scoring module.
+ #
+ # This method is actually a convenient shortcut for:
+ #
+ # Stamina::Scoring.scoring(signature(sample), sample.signature)
+ #
+ def scoring(sample)
+ Stamina::Scoring.scoring(signature(sample), sample.signature)
+ end
+ alias :classification_scoring :scoring
#
# Checks if a labeled sample is correctly classified by the classifier.
#
def correctly_classify?(sample)
@@ -32,6 +47,6 @@
end
true
end
end # module Classifier
-end # module Stamina
\ No newline at end of file
+end # module Stamina