Class: Clusterer::DocumentBase
- Inherits:
-
Hash
- Object
- Hash
- Clusterer::DocumentBase
- Includes:
- DocumentSimilarity
- Defined in:
- lib/clusterer/document_base.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods included from DocumentSimilarity
Instance Method Details
#vector_length ⇒ Object
28 29 30 |
# File 'lib/clusterer/document_base.rb', line 28 def vector_length @vector_length ||= Math.sqrt(self.inject(0) {|n,y| n + y[1]*y[1]}) end |