outliertree 0.2.1 → 0.3.0
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/CHANGELOG.md +5 -0
- data/NOTICE.txt +1 -1
- data/README.md +11 -10
- data/ext/outliertree/extconf.rb +1 -1
- data/lib/outliertree/result.rb +3 -3
- data/lib/outliertree/version.rb +1 -1
- data/vendor/outliertree/README.md +77 -40
- data/vendor/outliertree/src/Makevars.in +4 -0
- data/vendor/outliertree/src/Makevars.win +4 -0
- data/vendor/outliertree/src/RcppExports.cpp +20 -9
- data/vendor/outliertree/src/Rwrapper.cpp +256 -57
- data/vendor/outliertree/src/cat_outlier.cpp +6 -6
- data/vendor/outliertree/src/clusters.cpp +114 -9
- data/vendor/outliertree/src/fit_model.cpp +505 -308
- data/vendor/outliertree/src/misc.cpp +165 -4
- data/vendor/outliertree/src/outlier_tree.hpp +159 -51
- data/vendor/outliertree/src/outliertree-win.def +3 -0
- data/vendor/outliertree/src/predict.cpp +33 -0
- data/vendor/outliertree/src/split.cpp +124 -20
- metadata +8 -6
- data/vendor/outliertree/src/Makevars +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2851b4b56b23141bc9f1ef5b3c448fb75d785ce0e7b38580113001898ce18e2e
|
4
|
+
data.tar.gz: 817325392325bc61f1dea1363096678fe9fd578ec6026301e173447edc522752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1bc84c131959bb7260100b4aa1e345ae09330600252299084efe5d40fbff8d8d9d9aadf78c6384a0b6a158a1b3bbcdeff9de3ce71fca90ce938003125b37898
|
7
|
+
data.tar.gz: cad988456c492f101bc71334997217a48d6588c4e2e5feee333bc074f3b14b62557d0e64429fca787705244b701eca7d685aa17f090dad94578fce172812e5a0
|
data/CHANGELOG.md
CHANGED
data/NOTICE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# OutlierTree
|
1
|
+
# OutlierTree Ruby
|
2
2
|
|
3
3
|
:deciduous_tree: [OutlierTree](https://github.com/david-cortes/outliertree) - explainable outlier/anomaly detection - for Ruby
|
4
4
|
|
@@ -8,16 +8,16 @@ Produces human-readable explanations for why values are detected as outliers
|
|
8
8
|
Price (2.50) looks low given Department is Books and Sale is false
|
9
9
|
```
|
10
10
|
|
11
|
-
:evergreen_tree: Check out [IsoTree](https://github.com/ankane/isotree) for an alternative approach that uses Isolation Forest
|
11
|
+
:evergreen_tree: Check out [IsoTree](https://github.com/ankane/isotree-ruby) for an alternative approach that uses Isolation Forest
|
12
12
|
|
13
|
-
[](https://github.com/ankane/outliertree/actions)
|
13
|
+
[](https://github.com/ankane/outliertree-ruby/actions)
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
17
17
|
Add this line to your application’s Gemfile:
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem
|
20
|
+
gem "outliertree"
|
21
21
|
```
|
22
22
|
|
23
23
|
## Getting Started
|
@@ -28,7 +28,8 @@ Prep your data
|
|
28
28
|
data = [
|
29
29
|
{department: "Books", sale: false, price: 2.50},
|
30
30
|
{department: "Books", sale: true, price: 3.00},
|
31
|
-
{department: "Movies", sale: false, price: 5.00}
|
31
|
+
{department: "Movies", sale: false, price: 5.00},
|
32
|
+
# ...
|
32
33
|
]
|
33
34
|
```
|
34
35
|
|
@@ -108,22 +109,22 @@ bundle install
|
|
108
109
|
|
109
110
|
## History
|
110
111
|
|
111
|
-
View the [changelog](https://github.com/ankane/outliertree/blob/master/CHANGELOG.md)
|
112
|
+
View the [changelog](https://github.com/ankane/outliertree-ruby/blob/master/CHANGELOG.md)
|
112
113
|
|
113
114
|
## Contributing
|
114
115
|
|
115
116
|
Everyone is encouraged to help improve this project. Here are a few ways you can help:
|
116
117
|
|
117
|
-
- [Report bugs](https://github.com/ankane/outliertree/issues)
|
118
|
-
- Fix bugs and [submit pull requests](https://github.com/ankane/outliertree/pulls)
|
118
|
+
- [Report bugs](https://github.com/ankane/outliertree-ruby/issues)
|
119
|
+
- Fix bugs and [submit pull requests](https://github.com/ankane/outliertree-ruby/pulls)
|
119
120
|
- Write, clarify, or fix documentation
|
120
121
|
- Suggest or add new features
|
121
122
|
|
122
123
|
To get started with development:
|
123
124
|
|
124
125
|
```sh
|
125
|
-
git clone --recursive https://github.com/ankane/outliertree.git
|
126
|
-
cd outliertree
|
126
|
+
git clone --recursive https://github.com/ankane/outliertree-ruby.git
|
127
|
+
cd outliertree-ruby
|
127
128
|
bundle install
|
128
129
|
bundle exec rake compile
|
129
130
|
bundle exec rake test
|
data/ext/outliertree/extconf.rb
CHANGED
data/lib/outliertree/result.rb
CHANGED
@@ -22,7 +22,7 @@ module OutlierTree
|
|
22
22
|
if outl_col < @numeric_columns.size
|
23
23
|
column = @numeric_columns[outl_col]
|
24
24
|
value = df[column][row]
|
25
|
-
|
25
|
+
_decimals = model_outputs.outlier_decimals_distr[row]
|
26
26
|
else
|
27
27
|
column = @categorical_columns[outl_col - @numeric_columns.size]
|
28
28
|
value = df[column][row]
|
@@ -94,11 +94,11 @@ module OutlierTree
|
|
94
94
|
private
|
95
95
|
|
96
96
|
def add_condition(row, split_type, cluster)
|
97
|
-
|
97
|
+
_coldecim = 0
|
98
98
|
case cluster.column_type
|
99
99
|
when :numeric
|
100
100
|
cond_col = @numeric_columns[cluster.col_num]
|
101
|
-
|
101
|
+
_coldecim = model_outputs.min_decimals_col[cluster.col_num]
|
102
102
|
else
|
103
103
|
cond_col = @categorical_columns[cluster.col_num]
|
104
104
|
end
|
data/lib/outliertree/version.rb
CHANGED
@@ -1,47 +1,60 @@
|
|
1
1
|
# OutlierTree
|
2
2
|
|
3
|
-
Explainable outlier/anomaly detection based on smart decision tree grouping, similar in spirit to the GritBot software developed by RuleQuest research. Written in C++ with interfaces for R and Python. Supports columns of types numeric, categorical, binary/boolean, and ordinal, and can handle missing values in all of them. Ideal as a sanity checker in exploratory data analysis.
|
4
|
-
|
5
|
-
# How it works
|
6
|
-
|
7
|
-
Will try to fit decision trees that try to "predict" values for each column based on the values of each other column. Along the way, each time a split is evaluated, it will take the observations that fall into each branch as a homogeneous cluster in which it will search for outliers in the 1-d distribution of the column being predicted. Outliers are determined according to confidence intervals on this 1-d distribution, and need to have a large gap with respect to the next observation in sorted order to be flagged as outliers. Since outliers are searched for in a decision tree branch, it will know the conditions that make it a rare observation compared to others that meet the same conditions, and the conditions will always be correlated with the target variable (as it's being predicted from them).
|
8
|
-
|
9
|
-
As such, it will only be able to detect outliers that can be described through a decision tree logic, and unlike other methods such as [Isolation Forests](https://github.com/david-cortes/isotree), will not be able to assign an outlier score to each observation, nor to detect outliers that are just overall rare, but will always provide a human-readable justification when it flags an outlier.
|
10
|
-
|
11
|
-
Procedure is described in more detail in [Explainable outlier detection through decision tree conditioning](http://arxiv.org/abs/2001.00636).
|
3
|
+
Explainable outlier/anomaly detection based on smart decision tree grouping, similar in spirit to the GritBot software developed by RuleQuest research. Written in C++ with interfaces for R and Python (additional Ruby wrapper can be found [here](https://github.com/ankane/outliertree/)). Supports columns of types numeric, categorical, binary/boolean, and ordinal, and can handle missing values in all of them. Ideal as a sanity checker in exploratory data analysis.
|
12
4
|
|
13
5
|
# Example outputs
|
14
6
|
|
15
|
-
Example outliers from [hypothyroid dataset](http://archive.ics.uci.edu/ml/datasets/thyroid+disease):
|
7
|
+
Example outliers from the [hypothyroid dataset](http://archive.ics.uci.edu/ml/datasets/thyroid+disease):
|
16
8
|
```
|
17
|
-
row [
|
18
|
-
distribution: 95.122% <= 42.
|
9
|
+
row [1138] - suspicious column: [age] - suspicious value: [75.00]
|
10
|
+
distribution: 95.122% <= 42.00 - [mean: 31.46] - [sd: 5.28] - [norm. obs: 39]
|
19
11
|
given:
|
20
|
-
[pregnant] = [
|
12
|
+
[pregnant] = [TRUE]
|
21
13
|
|
22
14
|
|
23
|
-
row [
|
24
|
-
distribution: 99.951% <= 7.
|
15
|
+
row [2230] - suspicious column: [T3] - suspicious value: [10.60]
|
16
|
+
distribution: 99.951% <= 7.10 - [mean: 1.98] - [sd: 0.75] - [norm. obs: 2050]
|
25
17
|
given:
|
26
|
-
[query
|
18
|
+
[query.hyperthyroid] = [FALSE]
|
19
|
+
|
20
|
+
row [745] - suspicious column: [TT4] - suspicious value: [239.00]
|
21
|
+
distribution: 98.571% <= 177.00 - [mean: 135.23] - [sd: 12.57] - [norm. obs: 69]
|
22
|
+
given:
|
23
|
+
[FTI] between (97.96, 128.12] (value: 112.74)
|
24
|
+
[T4U] > [1.12] (value: 2.12)
|
25
|
+
[age] > [55.00] (value: 87.00)
|
27
26
|
```
|
28
27
|
(i.e. it's saying that it's abnormal to be pregnant at the age of 75, or to not be classified as hyperthyroidal when having very high thyroid hormone levels)
|
29
28
|
(this dataset is also bundled into the R package - e.g. `data(hypothyroid)`)
|
30
29
|
|
31
30
|
|
32
|
-
Example
|
31
|
+
Example outliers from the [Titanic dataset](https://www.kaggle.com/c/titanic):
|
33
32
|
```
|
34
|
-
row [
|
35
|
-
distribution: 97.849% <= 15.
|
33
|
+
row [1147] - suspicious column: [Fare] - suspicious value: [29.12]
|
34
|
+
distribution: 97.849% <= 15.50 - [mean: 7.89] - [sd: 1.17] - [norm. obs: 91]
|
36
35
|
given:
|
37
36
|
[Pclass] = [3]
|
38
37
|
[SibSp] = [0]
|
39
38
|
[Embarked] = [Q]
|
39
|
+
|
40
|
+
row [897] - suspicious column: [Fare] - suspicious value: [0.00]
|
41
|
+
distribution: 99.216% >= 3.17 - [mean: 9.68] - [sd: 6.98] - [norm. obs: 506]
|
42
|
+
given:
|
43
|
+
[Pclass] = [3]
|
44
|
+
[SibSp] = [0]
|
40
45
|
```
|
41
|
-
(i.e. it's saying that the
|
46
|
+
(i.e. it's saying that the the first person paid too much for the kind of accomodation he had, and the second person should not have gotten it for free)
|
42
47
|
|
43
48
|
_Note that it can also produce other types of conditions such as 'between' (for numeric intervals) or 'in' (for categorical subsets)_
|
44
49
|
|
50
|
+
# How it works
|
51
|
+
|
52
|
+
Will try to fit decision trees that try to "predict" values for each column based on the values of each other column. Along the way, each time a split is evaluated, it will take the observations that fall into each branch as a homogeneous cluster in which it will search for outliers in the 1-d distribution of the column being predicted. Outliers are determined according to confidence intervals on this 1-d distribution, and need to have a large gap with respect to the next observation in sorted order to be flagged as outliers. Since outliers are searched for in a decision tree branch, it will know the conditions that make it a rare observation compared to others that meet the same conditions, and the conditions will always be correlated with the target variable (as it's being predicted from them).
|
53
|
+
|
54
|
+
As such, it will only be able to detect outliers that can be described through a decision tree logic, and unlike other methods such as [Isolation Forests](https://github.com/david-cortes/isotree), will not be able to assign an outlier score to each observation, nor to detect outliers that are just overall rare, but will always provide a human-readable justification when it flags an outlier.
|
55
|
+
|
56
|
+
Procedure is described in more detail in [Explainable outlier detection through decision tree conditioning](http://arxiv.org/abs/2001.00636).
|
57
|
+
|
45
58
|
# Installation
|
46
59
|
|
47
60
|
* For R:
|
@@ -54,18 +67,38 @@ install.packages("outliertree")
|
|
54
67
|
```
|
55
68
|
pip install outliertree
|
56
69
|
```
|
57
|
-
|
70
|
+
or if that fails:
|
71
|
+
```
|
72
|
+
pip install --no-use-pep517 outliertree
|
73
|
+
```
|
74
|
+
** *
|
58
75
|
|
59
|
-
**Note for macOS users:** on macOS, the Python version of this package
|
76
|
+
**Note for macOS users:** on macOS, the Python version of this package might compile **without** multi-threading capabilities. In order to enable multi-threading support, first install OpenMP:
|
60
77
|
```
|
61
|
-
|
78
|
+
brew install libomp
|
79
|
+
```
|
80
|
+
And then reinstall this package: `pip install --force-reinstall outliertree`.
|
81
|
+
|
82
|
+
** *
|
83
|
+
**IMPORTANT:** the setup script will try to add compilation flag `-march=native`. This instructs the compiler to tune the package for the CPU in which it is being installed, but the result might not be usable in other computers. If building a binary wheel of this package or putting it into a docker image which will be used in different machines, this can be overriden by manually supplying compilation `CFLAGS` and `CXXFLAGS` as environment variables with something related to architecture. For maximum compatibility (but slowest speed), assuming `x86-64` computers, it's possible to do something like this:
|
84
|
+
|
85
|
+
```
|
86
|
+
export CFLAGS="-march=x86-64"
|
87
|
+
export CXXFLAGS="-march=x86-64"
|
62
88
|
pip install outliertree
|
63
89
|
```
|
64
|
-
(Alternatively, can also pass argument `enable-omp` to the `setup.py` file: `python setup.py install enable-omp`)
|
65
90
|
|
91
|
+
or for creating wheels:
|
92
|
+
```
|
93
|
+
export CFLAGS="-march=x86-64"
|
94
|
+
export CXXFLAGS="-march=x86-64"
|
95
|
+
python setup.py bwheel
|
96
|
+
```
|
97
|
+
** *
|
66
98
|
|
67
99
|
* For C++: package doesn't have a build system, nor a `main` function that can produce an executable, but can be built as a shared object and wrapped into other languages with any C++11-compliant compiler (`std=c++11` in most compilers, `/std:c++14` in MSVC). For parallelization, needs OpenMP linkage (`-fopenmp` in most compilers, `/openmp` in MSVC). Package should *not* be built with optimization higher than `O3` (i.e. don't use `-Ofast`). Needs linkage to the `math` library, which should be enabled by default in most C++ compilers, but otherwise would require `-lm` argument. No external dependencies are required.
|
68
100
|
|
101
|
+
* For Ruby: see [external repository with wrapper](https://github.com/ankane/outliertree/).
|
69
102
|
|
70
103
|
# Sample usage
|
71
104
|
|
@@ -77,18 +110,18 @@ library(outliertree)
|
|
77
110
|
nrows = 100
|
78
111
|
set.seed(1)
|
79
112
|
df = data.frame(
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
113
|
+
numeric_col1 = c(rnorm(nrows - 1), 1e6),
|
114
|
+
numeric_col2 = rgamma(nrows, 1),
|
115
|
+
categ_col = sample(c('categA', 'categB', 'categC'), size = nrows, replace = TRUE)
|
116
|
+
)
|
84
117
|
|
85
118
|
### test data frame with another obvious outlier
|
86
119
|
nrows_test = 50
|
87
120
|
df_test = data.frame(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
121
|
+
numeric_col1 = rnorm(nrows_test),
|
122
|
+
numeric_col2 = c(-1e6, rgamma(nrows_test - 1, 1)),
|
123
|
+
categ_col = sample(c('categA', 'categB', 'categC'), size = nrows_test, replace = TRUE)
|
124
|
+
)
|
92
125
|
|
93
126
|
### fit model
|
94
127
|
outliers_model = outliertree::outlier.tree(df, outliers_print = 10, save_outliers = TRUE)
|
@@ -113,17 +146,17 @@ from outliertree import OutlierTree
|
|
113
146
|
nrows = 100
|
114
147
|
np.random.seed(1)
|
115
148
|
df = pd.DataFrame({
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
149
|
+
"numeric_col1" : np.r_[np.random.normal(size = nrows - 1), np.array([float(1e6)])],
|
150
|
+
"numeric_col2" : np.random.gamma(1, 1, size = nrows),
|
151
|
+
"categ_col" : np.random.choice(['categA', 'categB', 'categC'], size = nrows)
|
152
|
+
})
|
120
153
|
|
121
154
|
### test data frame with another obvious outlier
|
122
155
|
df_test = pd.DataFrame({
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
156
|
+
"numeric_col1" : np.random.normal(size = nrows),
|
157
|
+
"numeric_col2" : np.r_[np.array([float(-1e6)]), np.random.gamma(1, 1, size = nrows - 1)],
|
158
|
+
"categ_col" : np.random.choice(['categA', 'categB', 'categC'], size = nrows)
|
159
|
+
})
|
127
160
|
|
128
161
|
### fit model
|
129
162
|
outliers_model = OutlierTree()
|
@@ -138,6 +171,8 @@ outliers_model.print_outliers(new_outliers)
|
|
138
171
|
|
139
172
|
Example [IPython notebook](http://nbviewer.ipython.org/github/david-cortes/outliertree/blob/master/example/titanic_outliertree_python.ipynb) using the Titanic dataset.
|
140
173
|
|
174
|
+
* For Ruby: see the [external repository](https://github.com/ankane/outliertree/).
|
175
|
+
|
141
176
|
* For C++: see functions `fit_outliers_models` and `find_new_outliers` in header `outlier_tree.hpp`.
|
142
177
|
|
143
178
|
# Documentation
|
@@ -146,6 +181,8 @@ Example [IPython notebook](http://nbviewer.ipython.org/github/david-cortes/outli
|
|
146
181
|
|
147
182
|
* For Python: documentation is available at [ReadTheDocs](http://outliertree.readthedocs.io/en/latest/) (and it's also built-in in the package as docstrings, e.g. `help(outliertree.OutlierTree.fit)`).
|
148
183
|
|
184
|
+
* For Ruby: see the [external repository](https://github.com/ankane/outliertree/) and the [Python documentation](http://outliertree.readthedocs.io/en/latest/).
|
185
|
+
|
149
186
|
* For C++: documentation is available in the source files (not in the header).
|
150
187
|
|
151
188
|
# References
|
@@ -5,14 +5,19 @@
|
|
5
5
|
|
6
6
|
using namespace Rcpp;
|
7
7
|
|
8
|
+
#ifdef RCPP_USE_GLOBAL_ROSTREAM
|
9
|
+
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
|
10
|
+
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
|
11
|
+
#endif
|
12
|
+
|
8
13
|
// deserialize_OutlierTree
|
9
|
-
SEXP deserialize_OutlierTree(Rcpp::RawVector src);
|
10
|
-
RcppExport SEXP _outliertree_deserialize_OutlierTree(SEXP srcSEXP) {
|
14
|
+
SEXP deserialize_OutlierTree(Rcpp::RawVector src, SEXP ptr_obj);
|
15
|
+
RcppExport SEXP _outliertree_deserialize_OutlierTree(SEXP srcSEXP, SEXP ptr_objSEXP) {
|
11
16
|
BEGIN_RCPP
|
12
17
|
Rcpp::RObject rcpp_result_gen;
|
13
|
-
Rcpp::RNGScope rcpp_rngScope_gen;
|
14
18
|
Rcpp::traits::input_parameter< Rcpp::RawVector >::type src(srcSEXP);
|
15
|
-
|
19
|
+
Rcpp::traits::input_parameter< SEXP >::type ptr_obj(ptr_objSEXP);
|
20
|
+
rcpp_result_gen = Rcpp::wrap(deserialize_OutlierTree(src, ptr_obj));
|
16
21
|
return rcpp_result_gen;
|
17
22
|
END_RCPP
|
18
23
|
}
|
@@ -21,7 +26,6 @@ Rcpp::LogicalVector check_null_ptr_model(SEXP ptr_model);
|
|
21
26
|
RcppExport SEXP _outliertree_check_null_ptr_model(SEXP ptr_modelSEXP) {
|
22
27
|
BEGIN_RCPP
|
23
28
|
Rcpp::RObject rcpp_result_gen;
|
24
|
-
Rcpp::RNGScope rcpp_rngScope_gen;
|
25
29
|
Rcpp::traits::input_parameter< SEXP >::type ptr_model(ptr_modelSEXP);
|
26
30
|
rcpp_result_gen = Rcpp::wrap(check_null_ptr_model(ptr_model));
|
27
31
|
return rcpp_result_gen;
|
@@ -32,7 +36,6 @@ Rcpp::List fit_OutlierTree(Rcpp::NumericVector arr_num, size_t ncols_numeric, Rc
|
|
32
36
|
RcppExport SEXP _outliertree_fit_OutlierTree(SEXP arr_numSEXP, SEXP ncols_numericSEXP, SEXP arr_catSEXP, SEXP ncols_categSEXP, SEXP ncatSEXP, SEXP arr_ordSEXP, SEXP ncols_ordSEXP, SEXP ncat_ordSEXP, SEXP nrowsSEXP, SEXP cols_ignore_rSEXP, SEXP nthreadsSEXP, SEXP categ_as_binSEXP, SEXP ord_as_binSEXP, SEXP cat_bruteforce_subsetSEXP, SEXP categ_from_majSEXP, SEXP take_midSEXP, SEXP max_depthSEXP, SEXP max_perc_outliersSEXP, SEXP min_size_numericSEXP, SEXP min_size_categSEXP, SEXP min_gainSEXP, SEXP follow_allSEXP, SEXP gain_as_pctSEXP, SEXP z_normSEXP, SEXP z_outlierSEXP, SEXP return_outliersSEXP, SEXP cat_levelsSEXP, SEXP ord_levelsSEXP, SEXP colnames_numSEXP, SEXP colnames_catSEXP, SEXP colnames_ordSEXP, SEXP min_dateSEXP, SEXP min_tsSEXP) {
|
33
37
|
BEGIN_RCPP
|
34
38
|
Rcpp::RObject rcpp_result_gen;
|
35
|
-
Rcpp::RNGScope rcpp_rngScope_gen;
|
36
39
|
Rcpp::traits::input_parameter< Rcpp::NumericVector >::type arr_num(arr_numSEXP);
|
37
40
|
Rcpp::traits::input_parameter< size_t >::type ncols_numeric(ncols_numericSEXP);
|
38
41
|
Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type arr_cat(arr_catSEXP);
|
@@ -75,7 +78,6 @@ Rcpp::List predict_OutlierTree(SEXP ptr_model, size_t nrows, int nthreads, Rcpp:
|
|
75
78
|
RcppExport SEXP _outliertree_predict_OutlierTree(SEXP ptr_modelSEXP, SEXP nrowsSEXP, SEXP nthreadsSEXP, SEXP arr_numSEXP, SEXP arr_catSEXP, SEXP arr_ordSEXP, SEXP cat_levelsSEXP, SEXP ord_levelsSEXP, SEXP colnames_numSEXP, SEXP colnames_catSEXP, SEXP colnames_ordSEXP, SEXP min_dateSEXP, SEXP min_tsSEXP) {
|
76
79
|
BEGIN_RCPP
|
77
80
|
Rcpp::RObject rcpp_result_gen;
|
78
|
-
Rcpp::RNGScope rcpp_rngScope_gen;
|
79
81
|
Rcpp::traits::input_parameter< SEXP >::type ptr_model(ptr_modelSEXP);
|
80
82
|
Rcpp::traits::input_parameter< size_t >::type nrows(nrowsSEXP);
|
81
83
|
Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
|
@@ -98,7 +100,6 @@ Rcpp::LogicalVector check_few_values(Rcpp::NumericVector arr_num, size_t nrows,
|
|
98
100
|
RcppExport SEXP _outliertree_check_few_values(SEXP arr_numSEXP, SEXP nrowsSEXP, SEXP ncolsSEXP, SEXP nthreadsSEXP) {
|
99
101
|
BEGIN_RCPP
|
100
102
|
Rcpp::RObject rcpp_result_gen;
|
101
|
-
Rcpp::RNGScope rcpp_rngScope_gen;
|
102
103
|
Rcpp::traits::input_parameter< Rcpp::NumericVector >::type arr_num(arr_numSEXP);
|
103
104
|
Rcpp::traits::input_parameter< size_t >::type nrows(nrowsSEXP);
|
104
105
|
Rcpp::traits::input_parameter< size_t >::type ncols(ncolsSEXP);
|
@@ -107,13 +108,23 @@ BEGIN_RCPP
|
|
107
108
|
return rcpp_result_gen;
|
108
109
|
END_RCPP
|
109
110
|
}
|
111
|
+
// R_has_openmp
|
112
|
+
bool R_has_openmp();
|
113
|
+
RcppExport SEXP _outliertree_R_has_openmp() {
|
114
|
+
BEGIN_RCPP
|
115
|
+
Rcpp::RObject rcpp_result_gen;
|
116
|
+
rcpp_result_gen = Rcpp::wrap(R_has_openmp());
|
117
|
+
return rcpp_result_gen;
|
118
|
+
END_RCPP
|
119
|
+
}
|
110
120
|
|
111
121
|
static const R_CallMethodDef CallEntries[] = {
|
112
|
-
{"_outliertree_deserialize_OutlierTree", (DL_FUNC) &_outliertree_deserialize_OutlierTree,
|
122
|
+
{"_outliertree_deserialize_OutlierTree", (DL_FUNC) &_outliertree_deserialize_OutlierTree, 2},
|
113
123
|
{"_outliertree_check_null_ptr_model", (DL_FUNC) &_outliertree_check_null_ptr_model, 1},
|
114
124
|
{"_outliertree_fit_OutlierTree", (DL_FUNC) &_outliertree_fit_OutlierTree, 33},
|
115
125
|
{"_outliertree_predict_OutlierTree", (DL_FUNC) &_outliertree_predict_OutlierTree, 13},
|
116
126
|
{"_outliertree_check_few_values", (DL_FUNC) &_outliertree_check_few_values, 4},
|
127
|
+
{"_outliertree_R_has_openmp", (DL_FUNC) &_outliertree_R_has_openmp, 0},
|
117
128
|
{NULL, NULL, 0}
|
118
129
|
};
|
119
130
|
|