rcf 0.1.0 → 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.
@@ -0,0 +1,2 @@
1
+ RandomCutForest
2
+ Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -2,15 +2,17 @@
2
2
 
3
3
  [Random Cut Forest](https://github.com/aws/random-cut-forest-by-aws) (RCF) anomaly detection for C/C++
4
4
 
5
+ :evergreen_tree: Also available for [Ruby](https://github.com/ankane/random-cut-forest-ruby) and [PHP](https://github.com/ankane/random-cut-forest-php), and as a [CLI](https://github.com/ankane/rcf-cli)
6
+
5
7
  [![Build Status](https://github.com/ankane/librcf/workflows/build/badge.svg?branch=master)](https://github.com/ankane/librcf/actions)
6
8
 
7
9
  ## Installation
8
10
 
9
11
  Download the latest version:
10
12
 
11
- - Linux - [x86_64](https://github.com/ankane/librcf/releases/download/v0.1.0/librcf-0.1.0-x86_64-unknown-linux-gnu.tar.gz) or [arm64](https://github.com/ankane/librcf/releases/download/v0.1.0/librcf-0.1.0-aarch64-unknown-linux-gnu.tar.gz)
12
- - Mac - [x86_64](https://github.com/ankane/librcf/releases/download/v0.1.0/librcf-0.1.0-x86_64-apple-darwin.tar.gz) or [arm64](https://github.com/ankane/librcf/releases/download/v0.1.0/librcf-0.1.0-aarch64-apple-darwin.tar.gz)
13
- - Windows - [x86_64](https://github.com/ankane/librcf/releases/download/v0.1.0/librcf-0.1.0-x86_64-pc-windows-msvc.zip)
13
+ - Linux - [x86_64](https://github.com/ankane/librcf/releases/download/v0.1.1/librcf-0.1.1-x86_64-unknown-linux-gnu.tar.gz) or [arm64](https://github.com/ankane/librcf/releases/download/v0.1.1/librcf-0.1.1-aarch64-unknown-linux-gnu.tar.gz)
14
+ - Mac - [x86_64](https://github.com/ankane/librcf/releases/download/v0.1.1/librcf-0.1.1-x86_64-apple-darwin.tar.gz) or [arm64](https://github.com/ankane/librcf/releases/download/v0.1.1/librcf-0.1.1-aarch64-apple-darwin.tar.gz)
15
+ - Windows - [x86_64](https://github.com/ankane/librcf/releases/download/v0.1.1/librcf-0.1.1-x86_64-pc-windows-msvc.zip)
14
16
 
15
17
  You can also install it with Homebrew:
16
18
 
@@ -32,6 +34,12 @@ Create a forest with 3 dimensions
32
34
  rcf_forest *forest = rcf_create(3);
33
35
  ```
34
36
 
37
+ Set parameters
38
+
39
+ ```c
40
+ rcf_set_param(forest, "number_of_trees", "100");
41
+ ```
42
+
35
43
  Score a point
36
44
 
37
45
  ```c
@@ -65,6 +73,7 @@ float randf() {
65
73
 
66
74
  int main() {
67
75
  rcf_forest *forest = rcf_create(3);
76
+ rcf_set_param(forest, "number_of_trees", "100");
68
77
 
69
78
  for (int i = 0; i < 200; i++) {
70
79
  float point[] = {randf(), randf(), randf()};
@@ -84,6 +93,28 @@ int main() {
84
93
  }
85
94
  ```
86
95
 
96
+ ## Parameters
97
+
98
+ Name | Description | Default Value
99
+ --- | --- | ---
100
+ `shingle_size` | Shingle size to use | 1
101
+ `sample_size` | Points to keep in sample for each tree | 256
102
+ `number_of_trees` | Number of trees to use in the forest | 100
103
+ `random_seed` | Random seed to use | 42
104
+ `parallel` | Enable parallel execution | false
105
+
106
+ Parameter values should always be passed as strings.
107
+
108
+ ```c
109
+ rcf_set_param(forest, "parallel", "true");
110
+ ```
111
+
112
+ `rcf_set_param` returns zero if successful and nonzero if the name or value is invalid or if it’s called after `rcf_score` or `rcf_update`.
113
+
114
+ ## Reference
115
+
116
+ - [Robust Random Cut Forest Based Anomaly Detection On Streams](https://proceedings.mlr.press/v48/guha16.pdf)
117
+
87
118
  ## History
88
119
 
89
120
  View the [changelog](CHANGELOG.md)
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.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: 2022-11-03 00:00:00.000000000 Z
11
+ date: 2023-06-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -18,30 +18,36 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - CHANGELOG.md
20
20
  - LICENSE.txt
21
+ - NOTICE.txt
21
22
  - README.md
22
23
  - lib/rcf.rb
23
24
  - lib/rcf/ffi.rb
24
25
  - lib/rcf/forest.rb
25
26
  - lib/rcf/version.rb
26
27
  - vendor/aarch64-linux/LICENSE
28
+ - vendor/aarch64-linux/LICENSE-THIRD-PARTY
29
+ - vendor/aarch64-linux/NOTICE
27
30
  - vendor/aarch64-linux/README.md
28
- - vendor/aarch64-linux/THIRD-PARTY-LICENSES
29
31
  - vendor/aarch64-linux/lib/librcf.so
30
32
  - vendor/arm64-darwin/LICENSE
33
+ - vendor/arm64-darwin/LICENSE-THIRD-PARTY
34
+ - vendor/arm64-darwin/NOTICE
31
35
  - vendor/arm64-darwin/README.md
32
- - vendor/arm64-darwin/THIRD-PARTY-LICENSES
33
36
  - vendor/arm64-darwin/lib/librcf.dylib
34
37
  - vendor/x64-mingw/LICENSE
38
+ - vendor/x64-mingw/LICENSE-THIRD-PARTY
39
+ - vendor/x64-mingw/NOTICE
35
40
  - vendor/x64-mingw/README.md
36
- - vendor/x64-mingw/THIRD-PARTY-LICENSES
37
41
  - vendor/x64-mingw/lib/rcf.dll
38
42
  - vendor/x86_64-darwin/LICENSE
43
+ - vendor/x86_64-darwin/LICENSE-THIRD-PARTY
44
+ - vendor/x86_64-darwin/NOTICE
39
45
  - vendor/x86_64-darwin/README.md
40
- - vendor/x86_64-darwin/THIRD-PARTY-LICENSES
41
46
  - vendor/x86_64-darwin/lib/librcf.dylib
42
47
  - vendor/x86_64-linux/LICENSE
48
+ - vendor/x86_64-linux/LICENSE-THIRD-PARTY
49
+ - vendor/x86_64-linux/NOTICE
43
50
  - vendor/x86_64-linux/README.md
44
- - vendor/x86_64-linux/THIRD-PARTY-LICENSES
45
51
  - vendor/x86_64-linux/lib/librcf.so
46
52
  homepage: https://github.com/ankane/random-cut-forest-ruby
47
53
  licenses:
@@ -62,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
68
  - !ruby/object:Gem::Version
63
69
  version: '0'
64
70
  requirements: []
65
- rubygems_version: 3.3.7
71
+ rubygems_version: 3.4.10
66
72
  signing_key:
67
73
  specification_version: 4
68
74
  summary: Random Cut Forest anomaly detection for Ruby