isotree 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/isotree/isolation_forest.rb +8 -2
- data/lib/isotree/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15de55d1a752d14cc97e2b5372308b2d4cb6a1e6fcfce0a05da6f769708b189
|
4
|
+
data.tar.gz: af21414cea40a26b2e291230e5d48bf4f804e1c77837a3132921b896bc617961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8127b5402c9c9f03bd2bd475b01a5cc8fbd3900ac1517d401ff4647d634e1f1049c8de51086095b132f30217f3571f8aa9e84c5fd18a0d3ac420a84203da85b7
|
7
|
+
data.tar.gz: 63b26ee19d8c49ce33d61891110db56597221a776830eb2aaad84c6d46038cb30822431a6f30b1051289f6becab0b652d968fbd4cf065c0925d50d5ef769c89a
|
data/CHANGELOG.md
CHANGED
@@ -54,8 +54,11 @@ module IsoTree
|
|
54
54
|
if defined?(Numo::NArray) && x.is_a?(Numo::NArray)
|
55
55
|
raise ArgumentError, "Input must have 2 dimensions" if x.ndim != 2
|
56
56
|
x = x.cast_to(Numo::DFloat)
|
57
|
-
numeric_data = x.to_binary
|
58
57
|
nrows, ncols = x.shape
|
58
|
+
numeric_data = String.new
|
59
|
+
ncols.times do |i|
|
60
|
+
numeric_data << x[true, i].to_binary
|
61
|
+
end
|
59
62
|
else
|
60
63
|
x = x.to_a
|
61
64
|
nrows = x.size
|
@@ -63,7 +66,10 @@ module IsoTree
|
|
63
66
|
if x.any? { |r| r.size != ncols }
|
64
67
|
raise ArgumentError, "All rows must have the same number of columns"
|
65
68
|
end
|
66
|
-
numeric_data =
|
69
|
+
numeric_data = String.new
|
70
|
+
ncols.times do |i|
|
71
|
+
numeric_data << x.map { |v| v[i] }.pack("d*")
|
72
|
+
end
|
67
73
|
end
|
68
74
|
raise ArgumentError, "No data" if nrows == 0
|
69
75
|
|
data/lib/isotree/version.rb
CHANGED