isotree 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffdc3a4283698bfc43c5563bd1c8cb4dd41881ec0a9920bfbe91f01fcbe0e822
4
- data.tar.gz: 83cc4a38f6640fd5a37c2a6aabe0cba12e198bdbd7b010cabb34f8d36073a74b
3
+ metadata.gz: 1876c50ef4d9bbd7fc7898c222b9f10b8d287a38cf9d37af53e9841f63494299
4
+ data.tar.gz: ea7b60ae9683498df1910fb3f4774ce8c94daf9fe2a6e23ffd87a9d488bcc5ce
5
5
  SHA512:
6
- metadata.gz: b6642570d6330fc2d72b210a040985dfa025d5d0deed622d04533fe9bf830c6cd3dda1ace94ace3d034c8302aa360e5ef6eeda576b48340db4d6c95016b8979c
7
- data.tar.gz: df0716c317e01bd174157e5c1b09e4f4e566f07512ea3861324b8fa9659a416c6ef1319580d2ee8a7231c74f74b9a9e5bdc9770a5adf0d208b82a22db1a9b29d
6
+ metadata.gz: 3d0f6d95cac8b7dd457512c0ce41c3ae286cf8f344ccc8a47dee1c00104657b3d2d9c97be1c1211fcb253065ba7fcf3d3b955a89dd9bac8b2b6e5e35516c7b7d
7
+ data.tar.gz: 476d7c8ffe5c252ba94ecc7a68e59fc3afbbb2a732fd9e3127e032e543a74957fcdef6173b6225dfee7370dbb86625b61b02d16a68cc7257be8f7cbdae87a581
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.2 (2022-06-12)
2
+
3
+ - Fixed segfault when data is smaller than sample size
4
+
1
5
  ## 0.2.1 (2021-05-23)
2
6
 
3
7
  - Improved performance
data/README.md CHANGED
@@ -1,19 +1,19 @@
1
- # IsoTree
1
+ # IsoTree Ruby
2
2
 
3
3
  :evergreen_tree: [IsoTree](https://github.com/david-cortes/isotree) - outlier/anomaly detection using Isolation Forest - for Ruby
4
4
 
5
5
  Learn how [Isolation Forest](https://www.youtube.com/watch?v=RyFQXQf4w4w) works
6
6
 
7
- :deciduous_tree: Check out [OutlierTree](https://github.com/ankane/outliertree) for human-readable explanations of outliers
7
+ :deciduous_tree: Check out [OutlierTree](https://github.com/ankane/outliertree-ruby) for human-readable explanations of outliers
8
8
 
9
- [![Build Status](https://github.com/ankane/isotree/workflows/build/badge.svg?branch=master)](https://github.com/ankane/isotree/actions)
9
+ [![Build Status](https://github.com/ankane/isotree-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/isotree-ruby/actions)
10
10
 
11
11
  ## Installation
12
12
 
13
13
  Add this line to your application’s Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'isotree'
16
+ gem "isotree"
17
17
  ```
18
18
 
19
19
  ## Getting Started
@@ -147,22 +147,22 @@ model.predict(data, output: "avg_depth")
147
147
 
148
148
  ## History
149
149
 
150
- View the [changelog](https://github.com/ankane/isotree/blob/master/CHANGELOG.md)
150
+ View the [changelog](https://github.com/ankane/isotree-ruby/blob/master/CHANGELOG.md)
151
151
 
152
152
  ## Contributing
153
153
 
154
154
  Everyone is encouraged to help improve this project. Here are a few ways you can help:
155
155
 
156
- - [Report bugs](https://github.com/ankane/isotree/issues)
157
- - Fix bugs and [submit pull requests](https://github.com/ankane/isotree/pulls)
156
+ - [Report bugs](https://github.com/ankane/isotree-ruby/issues)
157
+ - Fix bugs and [submit pull requests](https://github.com/ankane/isotree-ruby/pulls)
158
158
  - Write, clarify, or fix documentation
159
159
  - Suggest or add new features
160
160
 
161
161
  To get started with development:
162
162
 
163
163
  ```sh
164
- git clone --recursive https://github.com/ankane/isotree.git
165
- cd isotree
164
+ git clone --recursive https://github.com/ankane/isotree-ruby.git
165
+ cd isotree-ruby
166
166
  bundle install
167
167
  bundle exec rake compile
168
168
  bundle exec rake test
@@ -32,7 +32,6 @@ module IsoTree
32
32
  raise ArgumentError, "Array elements must be all hashes or arrays"
33
33
  end
34
34
 
35
- nrows = data.size
36
35
  ncols = data.first ? data.first.size : 0
37
36
  if data.any? { |r| r.size != ncols }
38
37
  raise ArgumentError, "All rows must have the same number of columns"
@@ -44,6 +44,10 @@ module IsoTree
44
44
  prep_fit(x)
45
45
  options = data_options(x).merge(fit_options)
46
46
  options[:sample_size] ||= options[:nrows]
47
+
48
+ # prevent segfault
49
+ options[:sample_size] = options[:nrows] if options[:sample_size] > options[:nrows]
50
+
47
51
  @ext_iso_forest = Ext.fit_iforest(options)
48
52
  end
49
53
 
@@ -1,3 +1,3 @@
1
1
  module IsoTree
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isotree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-23 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -149,7 +149,7 @@ files:
149
149
  - vendor/isotree/src/serialize.cpp
150
150
  - vendor/isotree/src/sql.cpp
151
151
  - vendor/isotree/src/utils.cpp
152
- homepage: https://github.com/ankane/isotree
152
+ homepage: https://github.com/ankane/isotree-ruby
153
153
  licenses:
154
154
  - BSD-2-Clause
155
155
  metadata: {}
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.2.3
171
+ rubygems_version: 3.3.7
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Outlier/anomaly detection for Ruby using Isolation Forest