Class: SameSame::MergeGoodnessMeasure
- Inherits:
-
Object
- Object
- SameSame::MergeGoodnessMeasure
- Defined in:
- lib/same_same/merge_goodness_measure.rb
Instance Attribute Summary collapse
-
#p ⇒ Object
readonly
Returns the value of attribute p.
-
#th ⇒ Object
readonly
Returns the value of attribute th.
Instance Method Summary collapse
- #g(number_of_links, size_x, size_y) ⇒ Object
-
#initialize(th) ⇒ MergeGoodnessMeasure
constructor
th should be >= 0 and <= 1 0 means all datapoints are neighbours 1 means no datapoints are neighbours (proximity).
Constructor Details
#initialize(th) ⇒ MergeGoodnessMeasure
th should be >= 0 and <= 1
0 means all datapoints are neighbours
1 means no datapoints are neighbours
(proximity)
10 11 12 13 |
# File 'lib/same_same/merge_goodness_measure.rb', line 10 def initialize( th ) @th = th @p = 1.0 + 2.0 * f( th ) end |
Instance Attribute Details
#p ⇒ Object (readonly)
Returns the value of attribute p.
4 5 6 |
# File 'lib/same_same/merge_goodness_measure.rb', line 4 def p @p end |
#th ⇒ Object (readonly)
Returns the value of attribute th.
4 5 6 |
# File 'lib/same_same/merge_goodness_measure.rb', line 4 def th @th end |
Instance Method Details
#g(number_of_links, size_x, size_y) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/same_same/merge_goodness_measure.rb', line 15 def g(number_of_links, size_x, size_y) a = (size_x + size_y) ** p b = size_x ** p c = size_x ** p number_of_links / (a - b - c) end |