NetAnalyzer 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/NetAnalyzer.rb +0 -1
- data/lib/NetAnalyzer/network.rb +11 -9
- data/lib/NetAnalyzer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 412854b58d2f6a2dbb1844cb943a90c9b96f7fd6
|
4
|
+
data.tar.gz: df275072cb0d1bb9b9d15099b089897471566eb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d3be799d9def07f7addef75dfad5a8d1c6b9d14c684d3dcb227b6be68ef22912ab069beb2e439d07a08b7dc2a6d7d0f38e873a1303a099c3c110c9cf6b075b
|
7
|
+
data.tar.gz: 561ad012584a397023897047b0e401a96246d39a67082f0c7cfd3ee6dc3cb8075d77d08bb75ae34a8174cbc13e5a8439f0348175f38133162f54ef9e6b55c07c
|
data/bin/NetAnalyzer.rb
CHANGED
data/lib/NetAnalyzer/network.rb
CHANGED
@@ -206,9 +206,10 @@ class Network
|
|
206
206
|
end
|
207
207
|
|
208
208
|
def get_geometric_associations(layers, base_layer)
|
209
|
+
#wang 2016 method
|
209
210
|
relations = get_associations(layers, base_layer) do |associatedIDs_node1, associatedIDs_node2, intersectedIDs, node1, node2|
|
210
211
|
intersectedIDs = intersectedIDs.length**2
|
211
|
-
productLength = associatedIDs_node1.length * associatedIDs_node2.length
|
212
|
+
productLength = Math.sqrt(associatedIDs_node1.length * associatedIDs_node2.length)
|
212
213
|
geometricValue = intersectedIDs.to_f/productLength
|
213
214
|
end
|
214
215
|
@association_values[:geometric] = relations
|
@@ -250,14 +251,15 @@ class Network
|
|
250
251
|
#Using index from A layer proyected to B
|
251
252
|
(intersection_lengths..minLength).each do |i|
|
252
253
|
binom_product = binom(nA, i) * binom(ny - nA, nB - i)
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
254
|
+
sum += binom_product.fdiv(binom(ny, nB))
|
255
|
+
# binom_product_float = binom_product.to_f
|
256
|
+
# to_f = false
|
257
|
+
# if binom_product_float.infinite? # Handle bignum coercition to bigdecimal to avoid infinity values on float class.
|
258
|
+
# binom_product_float = BigDecimal.new(binom_product)
|
259
|
+
# to_f = true
|
260
|
+
# end
|
261
|
+
# sum += binom_product_float / binom(ny, nB)
|
262
|
+
# sum = sum.to_f if to_f # once the operation has finished, sum is corced from bigdecimal to float
|
261
263
|
end
|
262
264
|
if sum == 0
|
263
265
|
hypergeometricValue = 0
|
data/lib/NetAnalyzer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: NetAnalyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elena Rojano, Pedro Seoane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|