isotree 0.3.0 → 0.3.1

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: a2ed0745b24db6c7d55b86cbf60394de590225509f3be5dbc79934606cd402cb
4
- data.tar.gz: d1601d80e3878cc678544a245defd04831e6f11f4f374ecff6d1916e1618af6e
3
+ metadata.gz: b07b4c1127d7fbdf12e03baebfd671d3dd06e163778654628942cdc16f18b21d
4
+ data.tar.gz: 1b3a2b09da4e4e4b8dd9d69c83e101926e1322b65932f3f9fd9f96914b5059f5
5
5
  SHA512:
6
- metadata.gz: b461f501114e56810ed6075fba28ae79a611763838147670f357a8a9645000f139072bf3bb3a2120cc09ad302df429d39f6b67522b1c2bc18862e75a65266eb4
7
- data.tar.gz: 57fc3f334fac2a6918ef95fb4827a67543a2aa5c1cdfcd86225c3411a409348593764109bcbc5155ddd6e49217f0764686847265550d145e72007556ae7fd00e
6
+ metadata.gz: b722fa013ee98be7dbf129191aededa2f347f9b1220423e740b7caccf0e0eab704f46bc8426edd60aaca68649ba8adbcd01a7d485c18eaca1106e795c4f00851
7
+ data.tar.gz: 56ae29ccb4b1982edab84bd419aa142eddddf3e7850941664f548583e5985a727f09763f9a6e332218b8b7a11ea0fdd73e70a779ed8a30a9ee20aecef287d8dc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.1 (2023-12-19)
2
+
3
+ - Updated IsoTree to 0.5.25
4
+
1
5
  ## 0.3.0 (2022-06-13)
2
6
 
3
7
  - Updated IsoTree to 0.5.16
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  BSD 2-Clause License
2
2
 
3
- Copyright (c) 2020-2022, David Cortes
4
- Copyright (c) 2020-2022, Andrew Kane
3
+ Copyright (c) 2019-2023, David Cortes
4
+ Copyright (c) 2020-2023, Andrew Kane
5
5
  All rights reserved.
6
6
 
7
7
  Redistribution and use in source and binary forms, with or without
@@ -1,3 +1,3 @@
1
1
  module IsoTree
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  BSD 2-Clause License
2
2
 
3
- Copyright (c) 2019-2022, David Cortes
3
+ Copyright (c) 2019-2023, David Cortes
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
@@ -117,6 +117,8 @@ There's already many available implementations of isolation forests for both Pyt
117
117
 
118
118
  * R:
119
119
 
120
+ **Note:** This package benefits from extra optimizations that aren't enabled by default for R packages. See [this guide](https://github.com/david-cortes/installing-optimized-libraries) for instructions on how to enable them.
121
+
120
122
  ```r
121
123
  install.packages("isotree")
122
124
  ```
@@ -125,6 +127,8 @@ install.packages("isotree")
125
127
 
126
128
  * Python:
127
129
 
130
+ **Note:** requires C/C++ compilers configured for Python. See [this guide](https://github.com/david-cortes/installing-optimized-libraries) for instructions.
131
+
128
132
  ```
129
133
  pip install isotree
130
134
  ```
@@ -138,7 +142,7 @@ pip install --no-use-pep517 isotree
138
142
  ```
139
143
  brew install libomp
140
144
  ```
141
- And then reinstall this package: `pip install --force-reinstall isotree`.
145
+ And then reinstall this package: `pip install --upgrade --no-deps --force-reinstall isotree`.
142
146
 
143
147
  ** *
144
148
  **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 (by e.g. using AVX instructions if available), 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 either by (a) defining an environment variable `DONT_SET_MARCH=1`, or by (b) manually supplying compilation `CFLAGS` as an environment variable with something related to architecture. For maximum compatibility (but slowest speed), it's possible to do something like this:
@@ -289,10 +293,6 @@ cmake -DNO_TEMPLATED_VERSIONS=1 ..
289
293
  (this option is not available for the Python build system)
290
294
 
291
295
 
292
- # Help wanted
293
-
294
- The package does not currenly have any functionality for visualizing trees. Pull requests adding such functionality would be welcome.
295
-
296
296
  # References
297
297
 
298
298
  * Liu, Fei Tony, Kai Ming Ting, and Zhi-Hua Zhou. "Isolation forest." 2008 Eighth IEEE International Conference on Data Mining. IEEE, 2008.
@@ -62,9 +62,12 @@
62
62
  */
63
63
 
64
64
  /* Standard headers */
65
+ #include <cmath>
65
66
  #include <cstddef>
66
67
  #include <cstdint>
67
68
  #include <vector>
69
+ #include <cstdio>
70
+ #include <iostream>
68
71
  using std::size_t;
69
72
 
70
73
  /* The library has overloaded functions supporting different input types.
@@ -164,6 +167,7 @@ typedef struct IsoForest {
164
167
  NewCategAction new_cat_action;
165
168
  CategSplit cat_split_type;
166
169
  MissingAction missing_action;
170
+ ScoringMetric scoring_metric;
167
171
  double exp_avg_depth;
168
172
  double exp_avg_sep;
169
173
  size_t orig_sample_size;
@@ -176,6 +180,7 @@ typedef struct ExtIsoForest {
176
180
  NewCategAction new_cat_action;
177
181
  CategSplit cat_split_type;
178
182
  MissingAction missing_action;
183
+ ScoringMetric scoring_metric;
179
184
  double exp_avg_depth;
180
185
  double exp_avg_sep;
181
186
  size_t orig_sample_size;
@@ -60,3 +60,73 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60
60
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61
61
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62
62
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63
+
64
+ ----------------
65
+
66
+ For the digamma function (file "src/digamma.hpp"):
67
+
68
+ Copyright (c) 2001-2002 Enthought, Inc. 2003-2023, SciPy Developers.
69
+ All rights reserved.
70
+
71
+ Redistribution and use in source and binary forms, with or without
72
+ modification, are permitted provided that the following conditions
73
+ are met:
74
+
75
+ 1. Redistributions of source code must retain the above copyright
76
+ notice, this list of conditions and the following disclaimer.
77
+
78
+ 2. Redistributions in binary form must reproduce the above
79
+ copyright notice, this list of conditions and the following
80
+ disclaimer in the documentation and/or other materials provided
81
+ with the distribution.
82
+
83
+ 3. Neither the name of the copyright holder nor the names of its
84
+ contributors may be used to endorse or promote products derived
85
+ from this software without specific prior written permission.
86
+
87
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
88
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
89
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
90
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
91
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
92
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
93
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
94
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
95
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
96
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
97
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
98
+
99
+ Distributed under 3-clause BSD license with permission from the author,
100
+ see https://lists.debian.org/debian-legal/2004/12/msg00295.html
101
+
102
+ ------------------------------------------------------------------
103
+
104
+ Cephes Math Library Release 2.8: June, 2000
105
+ Copyright 1984, 1995, 2000 by Stephen L. Moshier
106
+
107
+ This software is derived from the Cephes Math Library and is
108
+ incorporated herein by permission of the author.
109
+
110
+ All rights reserved.
111
+
112
+ Redistribution and use in source and binary forms, with or without
113
+ modification, are permitted provided that the following conditions are met:
114
+ * Redistributions of source code must retain the above copyright
115
+ notice, this list of conditions and the following disclaimer.
116
+ * Redistributions in binary form must reproduce the above copyright
117
+ notice, this list of conditions and the following disclaimer in the
118
+ documentation and/or other materials provided with the distribution.
119
+ * Neither the name of the <organization> nor the
120
+ names of its contributors may be used to endorse or promote products
121
+ derived from this software without specific prior written permission.
122
+
123
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
124
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
125
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
126
+ DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
127
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
128
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
129
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
130
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
131
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
132
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -50,19 +50,59 @@ BEGIN_RCPP
50
50
  return rcpp_result_gen;
51
51
  END_RCPP
52
52
  }
53
- // check_null_ptr_model
54
- Rcpp::LogicalVector check_null_ptr_model(SEXP ptr_model);
55
- RcppExport SEXP _isotree_check_null_ptr_model(SEXP ptr_modelSEXP) {
53
+ // serialize_IsoForest_from_ptr
54
+ SEXP serialize_IsoForest_from_ptr(SEXP R_ptr);
55
+ RcppExport SEXP _isotree_serialize_IsoForest_from_ptr(SEXP R_ptrSEXP) {
56
+ BEGIN_RCPP
57
+ Rcpp::RObject rcpp_result_gen;
58
+ Rcpp::traits::input_parameter< SEXP >::type R_ptr(R_ptrSEXP);
59
+ rcpp_result_gen = Rcpp::wrap(serialize_IsoForest_from_ptr(R_ptr));
60
+ return rcpp_result_gen;
61
+ END_RCPP
62
+ }
63
+ // serialize_ExtIsoForest_from_ptr
64
+ SEXP serialize_ExtIsoForest_from_ptr(SEXP R_ptr);
65
+ RcppExport SEXP _isotree_serialize_ExtIsoForest_from_ptr(SEXP R_ptrSEXP) {
66
+ BEGIN_RCPP
67
+ Rcpp::RObject rcpp_result_gen;
68
+ Rcpp::traits::input_parameter< SEXP >::type R_ptr(R_ptrSEXP);
69
+ rcpp_result_gen = Rcpp::wrap(serialize_ExtIsoForest_from_ptr(R_ptr));
70
+ return rcpp_result_gen;
71
+ END_RCPP
72
+ }
73
+ // serialize_Imputer_from_ptr
74
+ SEXP serialize_Imputer_from_ptr(SEXP R_ptr);
75
+ RcppExport SEXP _isotree_serialize_Imputer_from_ptr(SEXP R_ptrSEXP) {
76
+ BEGIN_RCPP
77
+ Rcpp::RObject rcpp_result_gen;
78
+ Rcpp::traits::input_parameter< SEXP >::type R_ptr(R_ptrSEXP);
79
+ rcpp_result_gen = Rcpp::wrap(serialize_Imputer_from_ptr(R_ptr));
80
+ return rcpp_result_gen;
81
+ END_RCPP
82
+ }
83
+ // serialize_Indexer_from_ptr
84
+ SEXP serialize_Indexer_from_ptr(SEXP R_ptr);
85
+ RcppExport SEXP _isotree_serialize_Indexer_from_ptr(SEXP R_ptrSEXP) {
86
+ BEGIN_RCPP
87
+ Rcpp::RObject rcpp_result_gen;
88
+ Rcpp::traits::input_parameter< SEXP >::type R_ptr(R_ptrSEXP);
89
+ rcpp_result_gen = Rcpp::wrap(serialize_Indexer_from_ptr(R_ptr));
90
+ return rcpp_result_gen;
91
+ END_RCPP
92
+ }
93
+ // check_null_ptr_model_internal
94
+ Rcpp::LogicalVector check_null_ptr_model_internal(SEXP ptr_model);
95
+ RcppExport SEXP _isotree_check_null_ptr_model_internal(SEXP ptr_modelSEXP) {
56
96
  BEGIN_RCPP
57
97
  Rcpp::RObject rcpp_result_gen;
58
98
  Rcpp::traits::input_parameter< SEXP >::type ptr_model(ptr_modelSEXP);
59
- rcpp_result_gen = Rcpp::wrap(check_null_ptr_model(ptr_model));
99
+ rcpp_result_gen = Rcpp::wrap(check_null_ptr_model_internal(ptr_model));
60
100
  return rcpp_result_gen;
61
101
  END_RCPP
62
102
  }
63
103
  // fit_model
64
- Rcpp::List fit_model(Rcpp::NumericVector X_num, Rcpp::IntegerVector X_cat, Rcpp::IntegerVector ncat, Rcpp::NumericVector Xc, Rcpp::IntegerVector Xc_ind, Rcpp::IntegerVector Xc_indptr, Rcpp::NumericVector sample_weights, Rcpp::NumericVector col_weights, size_t nrows, size_t ncols_numeric, size_t ncols_categ, size_t ndim, size_t ntry, Rcpp::CharacterVector coef_type, bool coef_by_prop, bool with_replacement, bool weight_as_sample, size_t sample_size, size_t ntrees, size_t max_depth, size_t ncols_per_tree, bool limit_depth, bool penalize_range, bool standardize_data, Rcpp::CharacterVector scoring_metric, bool fast_bratio, bool calc_dist, bool standardize_dist, bool sq_dist, bool calc_depth, bool standardize_depth, bool weigh_by_kurt, double prob_pick_by_gain_pl, double prob_pick_by_gain_avg, double prob_pick_by_full_gain, double prob_pick_by_dens, double prob_pick_col_by_range, double prob_pick_col_by_var, double prob_pick_col_by_kurt, double min_gain, Rcpp::CharacterVector cat_split_type, Rcpp::CharacterVector new_cat_action, Rcpp::CharacterVector missing_action, bool all_perm, bool build_imputer, bool output_imputations, size_t min_imp_obs, Rcpp::CharacterVector depth_imp, Rcpp::CharacterVector weigh_imp_rows, int random_seed, bool use_long_double, int nthreads);
65
- RcppExport SEXP _isotree_fit_model(SEXP X_numSEXP, SEXP X_catSEXP, SEXP ncatSEXP, SEXP XcSEXP, SEXP Xc_indSEXP, SEXP Xc_indptrSEXP, SEXP sample_weightsSEXP, SEXP col_weightsSEXP, SEXP nrowsSEXP, SEXP ncols_numericSEXP, SEXP ncols_categSEXP, SEXP ndimSEXP, SEXP ntrySEXP, SEXP coef_typeSEXP, SEXP coef_by_propSEXP, SEXP with_replacementSEXP, SEXP weight_as_sampleSEXP, SEXP sample_sizeSEXP, SEXP ntreesSEXP, SEXP max_depthSEXP, SEXP ncols_per_treeSEXP, SEXP limit_depthSEXP, SEXP penalize_rangeSEXP, SEXP standardize_dataSEXP, SEXP scoring_metricSEXP, SEXP fast_bratioSEXP, SEXP calc_distSEXP, SEXP standardize_distSEXP, SEXP sq_distSEXP, SEXP calc_depthSEXP, SEXP standardize_depthSEXP, SEXP weigh_by_kurtSEXP, SEXP prob_pick_by_gain_plSEXP, SEXP prob_pick_by_gain_avgSEXP, SEXP prob_pick_by_full_gainSEXP, SEXP prob_pick_by_densSEXP, SEXP prob_pick_col_by_rangeSEXP, SEXP prob_pick_col_by_varSEXP, SEXP prob_pick_col_by_kurtSEXP, SEXP min_gainSEXP, SEXP cat_split_typeSEXP, SEXP new_cat_actionSEXP, SEXP missing_actionSEXP, SEXP all_permSEXP, SEXP build_imputerSEXP, SEXP output_imputationsSEXP, SEXP min_imp_obsSEXP, SEXP depth_impSEXP, SEXP weigh_imp_rowsSEXP, SEXP random_seedSEXP, SEXP use_long_doubleSEXP, SEXP nthreadsSEXP) {
104
+ Rcpp::List fit_model(Rcpp::NumericVector X_num, Rcpp::IntegerVector X_cat, Rcpp::IntegerVector ncat, Rcpp::NumericVector Xc, Rcpp::IntegerVector Xc_ind, Rcpp::IntegerVector Xc_indptr, Rcpp::NumericVector sample_weights, Rcpp::NumericVector col_weights, size_t nrows, size_t ncols_numeric, size_t ncols_categ, size_t ndim, size_t ntry, Rcpp::CharacterVector coef_type, bool coef_by_prop, bool with_replacement, bool weight_as_sample, size_t sample_size, size_t ntrees, size_t max_depth, size_t ncols_per_tree, bool limit_depth, bool penalize_range, bool standardize_data, Rcpp::CharacterVector scoring_metric, bool fast_bratio, bool calc_dist, bool standardize_dist, bool sq_dist, bool calc_depth, bool standardize_depth, bool weigh_by_kurt, double prob_pick_by_gain_pl, double prob_pick_by_gain_avg, double prob_pick_by_full_gain, double prob_pick_by_dens, double prob_pick_col_by_range, double prob_pick_col_by_var, double prob_pick_col_by_kurt, double min_gain, Rcpp::CharacterVector cat_split_type, Rcpp::CharacterVector new_cat_action, Rcpp::CharacterVector missing_action, bool all_perm, bool build_imputer, bool output_imputations, size_t min_imp_obs, Rcpp::CharacterVector depth_imp, Rcpp::CharacterVector weigh_imp_rows, int random_seed, bool use_long_double, int nthreads, bool lazy_serialization);
105
+ RcppExport SEXP _isotree_fit_model(SEXP X_numSEXP, SEXP X_catSEXP, SEXP ncatSEXP, SEXP XcSEXP, SEXP Xc_indSEXP, SEXP Xc_indptrSEXP, SEXP sample_weightsSEXP, SEXP col_weightsSEXP, SEXP nrowsSEXP, SEXP ncols_numericSEXP, SEXP ncols_categSEXP, SEXP ndimSEXP, SEXP ntrySEXP, SEXP coef_typeSEXP, SEXP coef_by_propSEXP, SEXP with_replacementSEXP, SEXP weight_as_sampleSEXP, SEXP sample_sizeSEXP, SEXP ntreesSEXP, SEXP max_depthSEXP, SEXP ncols_per_treeSEXP, SEXP limit_depthSEXP, SEXP penalize_rangeSEXP, SEXP standardize_dataSEXP, SEXP scoring_metricSEXP, SEXP fast_bratioSEXP, SEXP calc_distSEXP, SEXP standardize_distSEXP, SEXP sq_distSEXP, SEXP calc_depthSEXP, SEXP standardize_depthSEXP, SEXP weigh_by_kurtSEXP, SEXP prob_pick_by_gain_plSEXP, SEXP prob_pick_by_gain_avgSEXP, SEXP prob_pick_by_full_gainSEXP, SEXP prob_pick_by_densSEXP, SEXP prob_pick_col_by_rangeSEXP, SEXP prob_pick_col_by_varSEXP, SEXP prob_pick_col_by_kurtSEXP, SEXP min_gainSEXP, SEXP cat_split_typeSEXP, SEXP new_cat_actionSEXP, SEXP missing_actionSEXP, SEXP all_permSEXP, SEXP build_imputerSEXP, SEXP output_imputationsSEXP, SEXP min_imp_obsSEXP, SEXP depth_impSEXP, SEXP weigh_imp_rowsSEXP, SEXP random_seedSEXP, SEXP use_long_doubleSEXP, SEXP nthreadsSEXP, SEXP lazy_serializationSEXP) {
66
106
  BEGIN_RCPP
67
107
  Rcpp::RObject rcpp_result_gen;
68
108
  Rcpp::traits::input_parameter< Rcpp::NumericVector >::type X_num(X_numSEXP);
@@ -117,13 +157,14 @@ BEGIN_RCPP
117
157
  Rcpp::traits::input_parameter< int >::type random_seed(random_seedSEXP);
118
158
  Rcpp::traits::input_parameter< bool >::type use_long_double(use_long_doubleSEXP);
119
159
  Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
120
- rcpp_result_gen = Rcpp::wrap(fit_model(X_num, X_cat, ncat, Xc, Xc_ind, Xc_indptr, sample_weights, col_weights, nrows, ncols_numeric, ncols_categ, ndim, ntry, coef_type, coef_by_prop, with_replacement, weight_as_sample, sample_size, ntrees, max_depth, ncols_per_tree, limit_depth, penalize_range, standardize_data, scoring_metric, fast_bratio, calc_dist, standardize_dist, sq_dist, calc_depth, standardize_depth, weigh_by_kurt, prob_pick_by_gain_pl, prob_pick_by_gain_avg, prob_pick_by_full_gain, prob_pick_by_dens, prob_pick_col_by_range, prob_pick_col_by_var, prob_pick_col_by_kurt, min_gain, cat_split_type, new_cat_action, missing_action, all_perm, build_imputer, output_imputations, min_imp_obs, depth_imp, weigh_imp_rows, random_seed, use_long_double, nthreads));
160
+ Rcpp::traits::input_parameter< bool >::type lazy_serialization(lazy_serializationSEXP);
161
+ rcpp_result_gen = Rcpp::wrap(fit_model(X_num, X_cat, ncat, Xc, Xc_ind, Xc_indptr, sample_weights, col_weights, nrows, ncols_numeric, ncols_categ, ndim, ntry, coef_type, coef_by_prop, with_replacement, weight_as_sample, sample_size, ntrees, max_depth, ncols_per_tree, limit_depth, penalize_range, standardize_data, scoring_metric, fast_bratio, calc_dist, standardize_dist, sq_dist, calc_depth, standardize_depth, weigh_by_kurt, prob_pick_by_gain_pl, prob_pick_by_gain_avg, prob_pick_by_full_gain, prob_pick_by_dens, prob_pick_col_by_range, prob_pick_col_by_var, prob_pick_col_by_kurt, min_gain, cat_split_type, new_cat_action, missing_action, all_perm, build_imputer, output_imputations, min_imp_obs, depth_imp, weigh_imp_rows, random_seed, use_long_double, nthreads, lazy_serialization));
121
162
  return rcpp_result_gen;
122
163
  END_RCPP
123
164
  }
124
165
  // fit_tree
125
- void fit_tree(SEXP model_R_ptr, Rcpp::RawVector serialized_obj, Rcpp::RawVector serialized_imputer, SEXP indexer_R_ptr, Rcpp::RawVector serialized_indexer, Rcpp::NumericVector X_num, Rcpp::IntegerVector X_cat, Rcpp::IntegerVector ncat, Rcpp::NumericVector Xc, Rcpp::IntegerVector Xc_ind, Rcpp::IntegerVector Xc_indptr, Rcpp::NumericVector sample_weights, Rcpp::NumericVector col_weights, size_t nrows, size_t ncols_numeric, size_t ncols_categ, size_t ndim, size_t ntry, Rcpp::CharacterVector coef_type, bool coef_by_prop, size_t max_depth, size_t ncols_per_tree, bool limit_depth, bool penalize_range, bool standardize_data, bool fast_bratio, bool weigh_by_kurt, double prob_pick_by_gain_pl, double prob_pick_by_gain_avg, double prob_pick_by_full_gain, double prob_pick_by_dens, double prob_pick_col_by_range, double prob_pick_col_by_var, double prob_pick_col_by_kurt, double min_gain, Rcpp::CharacterVector cat_split_type, Rcpp::CharacterVector new_cat_action, Rcpp::CharacterVector missing_action, bool build_imputer, size_t min_imp_obs, SEXP imp_R_ptr, Rcpp::CharacterVector depth_imp, Rcpp::CharacterVector weigh_imp_rows, bool all_perm, Rcpp::NumericVector ref_X_num, Rcpp::IntegerVector ref_X_cat, Rcpp::NumericVector ref_Xc, Rcpp::IntegerVector ref_Xc_ind, Rcpp::IntegerVector ref_Xc_indptr, uint64_t random_seed, bool use_long_double, Rcpp::List& model_cpp_obj_update, Rcpp::List& model_params_update);
126
- RcppExport SEXP _isotree_fit_tree(SEXP model_R_ptrSEXP, SEXP serialized_objSEXP, SEXP serialized_imputerSEXP, SEXP indexer_R_ptrSEXP, SEXP serialized_indexerSEXP, SEXP X_numSEXP, SEXP X_catSEXP, SEXP ncatSEXP, SEXP XcSEXP, SEXP Xc_indSEXP, SEXP Xc_indptrSEXP, SEXP sample_weightsSEXP, SEXP col_weightsSEXP, SEXP nrowsSEXP, SEXP ncols_numericSEXP, SEXP ncols_categSEXP, SEXP ndimSEXP, SEXP ntrySEXP, SEXP coef_typeSEXP, SEXP coef_by_propSEXP, SEXP max_depthSEXP, SEXP ncols_per_treeSEXP, SEXP limit_depthSEXP, SEXP penalize_rangeSEXP, SEXP standardize_dataSEXP, SEXP fast_bratioSEXP, SEXP weigh_by_kurtSEXP, SEXP prob_pick_by_gain_plSEXP, SEXP prob_pick_by_gain_avgSEXP, SEXP prob_pick_by_full_gainSEXP, SEXP prob_pick_by_densSEXP, SEXP prob_pick_col_by_rangeSEXP, SEXP prob_pick_col_by_varSEXP, SEXP prob_pick_col_by_kurtSEXP, SEXP min_gainSEXP, SEXP cat_split_typeSEXP, SEXP new_cat_actionSEXP, SEXP missing_actionSEXP, SEXP build_imputerSEXP, SEXP min_imp_obsSEXP, SEXP imp_R_ptrSEXP, SEXP depth_impSEXP, SEXP weigh_imp_rowsSEXP, SEXP all_permSEXP, SEXP ref_X_numSEXP, SEXP ref_X_catSEXP, SEXP ref_XcSEXP, SEXP ref_Xc_indSEXP, SEXP ref_Xc_indptrSEXP, SEXP random_seedSEXP, SEXP use_long_doubleSEXP, SEXP model_cpp_obj_updateSEXP, SEXP model_params_updateSEXP) {
166
+ void fit_tree(SEXP model_R_ptr, Rcpp::RawVector serialized_obj, Rcpp::RawVector serialized_imputer, SEXP indexer_R_ptr, Rcpp::RawVector serialized_indexer, Rcpp::NumericVector X_num, Rcpp::IntegerVector X_cat, Rcpp::IntegerVector ncat, Rcpp::NumericVector Xc, Rcpp::IntegerVector Xc_ind, Rcpp::IntegerVector Xc_indptr, Rcpp::NumericVector sample_weights, Rcpp::NumericVector col_weights, size_t nrows, size_t ncols_numeric, size_t ncols_categ, size_t ndim, size_t ntry, Rcpp::CharacterVector coef_type, bool coef_by_prop, size_t max_depth, size_t ncols_per_tree, bool limit_depth, bool penalize_range, bool standardize_data, bool fast_bratio, bool weigh_by_kurt, double prob_pick_by_gain_pl, double prob_pick_by_gain_avg, double prob_pick_by_full_gain, double prob_pick_by_dens, double prob_pick_col_by_range, double prob_pick_col_by_var, double prob_pick_col_by_kurt, double min_gain, Rcpp::CharacterVector cat_split_type, Rcpp::CharacterVector new_cat_action, Rcpp::CharacterVector missing_action, bool build_imputer, size_t min_imp_obs, SEXP imp_R_ptr, Rcpp::CharacterVector depth_imp, Rcpp::CharacterVector weigh_imp_rows, bool all_perm, Rcpp::NumericVector ref_X_num, Rcpp::IntegerVector ref_X_cat, Rcpp::NumericVector ref_Xc, Rcpp::IntegerVector ref_Xc_ind, Rcpp::IntegerVector ref_Xc_indptr, uint64_t random_seed, bool use_long_double, Rcpp::List& model_cpp_obj_update, Rcpp::List& model_params_update, bool is_altrepped);
167
+ RcppExport SEXP _isotree_fit_tree(SEXP model_R_ptrSEXP, SEXP serialized_objSEXP, SEXP serialized_imputerSEXP, SEXP indexer_R_ptrSEXP, SEXP serialized_indexerSEXP, SEXP X_numSEXP, SEXP X_catSEXP, SEXP ncatSEXP, SEXP XcSEXP, SEXP Xc_indSEXP, SEXP Xc_indptrSEXP, SEXP sample_weightsSEXP, SEXP col_weightsSEXP, SEXP nrowsSEXP, SEXP ncols_numericSEXP, SEXP ncols_categSEXP, SEXP ndimSEXP, SEXP ntrySEXP, SEXP coef_typeSEXP, SEXP coef_by_propSEXP, SEXP max_depthSEXP, SEXP ncols_per_treeSEXP, SEXP limit_depthSEXP, SEXP penalize_rangeSEXP, SEXP standardize_dataSEXP, SEXP fast_bratioSEXP, SEXP weigh_by_kurtSEXP, SEXP prob_pick_by_gain_plSEXP, SEXP prob_pick_by_gain_avgSEXP, SEXP prob_pick_by_full_gainSEXP, SEXP prob_pick_by_densSEXP, SEXP prob_pick_col_by_rangeSEXP, SEXP prob_pick_col_by_varSEXP, SEXP prob_pick_col_by_kurtSEXP, SEXP min_gainSEXP, SEXP cat_split_typeSEXP, SEXP new_cat_actionSEXP, SEXP missing_actionSEXP, SEXP build_imputerSEXP, SEXP min_imp_obsSEXP, SEXP imp_R_ptrSEXP, SEXP depth_impSEXP, SEXP weigh_imp_rowsSEXP, SEXP all_permSEXP, SEXP ref_X_numSEXP, SEXP ref_X_catSEXP, SEXP ref_XcSEXP, SEXP ref_Xc_indSEXP, SEXP ref_Xc_indptrSEXP, SEXP random_seedSEXP, SEXP use_long_doubleSEXP, SEXP model_cpp_obj_updateSEXP, SEXP model_params_updateSEXP, SEXP is_altreppedSEXP) {
127
168
  BEGIN_RCPP
128
169
  Rcpp::traits::input_parameter< SEXP >::type model_R_ptr(model_R_ptrSEXP);
129
170
  Rcpp::traits::input_parameter< Rcpp::RawVector >::type serialized_obj(serialized_objSEXP);
@@ -178,7 +219,8 @@ BEGIN_RCPP
178
219
  Rcpp::traits::input_parameter< bool >::type use_long_double(use_long_doubleSEXP);
179
220
  Rcpp::traits::input_parameter< Rcpp::List& >::type model_cpp_obj_update(model_cpp_obj_updateSEXP);
180
221
  Rcpp::traits::input_parameter< Rcpp::List& >::type model_params_update(model_params_updateSEXP);
181
- fit_tree(model_R_ptr, serialized_obj, serialized_imputer, indexer_R_ptr, serialized_indexer, X_num, X_cat, ncat, Xc, Xc_ind, Xc_indptr, sample_weights, col_weights, nrows, ncols_numeric, ncols_categ, ndim, ntry, coef_type, coef_by_prop, max_depth, ncols_per_tree, limit_depth, penalize_range, standardize_data, fast_bratio, weigh_by_kurt, prob_pick_by_gain_pl, prob_pick_by_gain_avg, prob_pick_by_full_gain, prob_pick_by_dens, prob_pick_col_by_range, prob_pick_col_by_var, prob_pick_col_by_kurt, min_gain, cat_split_type, new_cat_action, missing_action, build_imputer, min_imp_obs, imp_R_ptr, depth_imp, weigh_imp_rows, all_perm, ref_X_num, ref_X_cat, ref_Xc, ref_Xc_ind, ref_Xc_indptr, random_seed, use_long_double, model_cpp_obj_update, model_params_update);
222
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
223
+ fit_tree(model_R_ptr, serialized_obj, serialized_imputer, indexer_R_ptr, serialized_indexer, X_num, X_cat, ncat, Xc, Xc_ind, Xc_indptr, sample_weights, col_weights, nrows, ncols_numeric, ncols_categ, ndim, ntry, coef_type, coef_by_prop, max_depth, ncols_per_tree, limit_depth, penalize_range, standardize_data, fast_bratio, weigh_by_kurt, prob_pick_by_gain_pl, prob_pick_by_gain_avg, prob_pick_by_full_gain, prob_pick_by_dens, prob_pick_col_by_range, prob_pick_col_by_var, prob_pick_col_by_kurt, min_gain, cat_split_type, new_cat_action, missing_action, build_imputer, min_imp_obs, imp_R_ptr, depth_imp, weigh_imp_rows, all_perm, ref_X_num, ref_X_cat, ref_Xc, ref_Xc_ind, ref_Xc_indptr, random_seed, use_long_double, model_cpp_obj_update, model_params_update, is_altrepped);
182
224
  return R_NilValue;
183
225
  END_RCPP
184
226
  }
@@ -256,47 +298,55 @@ BEGIN_RCPP
256
298
  END_RCPP
257
299
  }
258
300
  // drop_imputer
259
- void drop_imputer(Rcpp::List lst_modify, Rcpp::List lst_modify2);
260
- RcppExport SEXP _isotree_drop_imputer(SEXP lst_modifySEXP, SEXP lst_modify2SEXP) {
261
- BEGIN_RCPP
262
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify(lst_modifySEXP);
263
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify2(lst_modify2SEXP);
264
- drop_imputer(lst_modify, lst_modify2);
301
+ void drop_imputer(bool is_altrepped, bool free_cpp, SEXP lst_imputer, Rcpp::List lst_cpp_objects, Rcpp::List lst_params);
302
+ RcppExport SEXP _isotree_drop_imputer(SEXP is_altreppedSEXP, SEXP free_cppSEXP, SEXP lst_imputerSEXP, SEXP lst_cpp_objectsSEXP, SEXP lst_paramsSEXP) {
303
+ BEGIN_RCPP
304
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
305
+ Rcpp::traits::input_parameter< bool >::type free_cpp(free_cppSEXP);
306
+ Rcpp::traits::input_parameter< SEXP >::type lst_imputer(lst_imputerSEXP);
307
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_cpp_objects(lst_cpp_objectsSEXP);
308
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_params(lst_paramsSEXP);
309
+ drop_imputer(is_altrepped, free_cpp, lst_imputer, lst_cpp_objects, lst_params);
265
310
  return R_NilValue;
266
311
  END_RCPP
267
312
  }
268
313
  // drop_indexer
269
- void drop_indexer(Rcpp::List lst_modify, Rcpp::List lst_modify2);
270
- RcppExport SEXP _isotree_drop_indexer(SEXP lst_modifySEXP, SEXP lst_modify2SEXP) {
271
- BEGIN_RCPP
272
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify(lst_modifySEXP);
273
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify2(lst_modify2SEXP);
274
- drop_indexer(lst_modify, lst_modify2);
314
+ void drop_indexer(bool is_altrepped, bool free_cpp, SEXP lst_indexer, Rcpp::List lst_cpp_objects, Rcpp::List lst_metadata);
315
+ RcppExport SEXP _isotree_drop_indexer(SEXP is_altreppedSEXP, SEXP free_cppSEXP, SEXP lst_indexerSEXP, SEXP lst_cpp_objectsSEXP, SEXP lst_metadataSEXP) {
316
+ BEGIN_RCPP
317
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
318
+ Rcpp::traits::input_parameter< bool >::type free_cpp(free_cppSEXP);
319
+ Rcpp::traits::input_parameter< SEXP >::type lst_indexer(lst_indexerSEXP);
320
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_cpp_objects(lst_cpp_objectsSEXP);
321
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_metadata(lst_metadataSEXP);
322
+ drop_indexer(is_altrepped, free_cpp, lst_indexer, lst_cpp_objects, lst_metadata);
275
323
  return R_NilValue;
276
324
  END_RCPP
277
325
  }
278
326
  // drop_reference_points
279
- void drop_reference_points(Rcpp::List lst_modify, Rcpp::List lst_modify2);
280
- RcppExport SEXP _isotree_drop_reference_points(SEXP lst_modifySEXP, SEXP lst_modify2SEXP) {
281
- BEGIN_RCPP
282
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify(lst_modifySEXP);
283
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify2(lst_modify2SEXP);
284
- drop_reference_points(lst_modify, lst_modify2);
327
+ void drop_reference_points(bool is_altrepped, SEXP lst_indexer, Rcpp::List lst_cpp_objects, Rcpp::List lst_metadata);
328
+ RcppExport SEXP _isotree_drop_reference_points(SEXP is_altreppedSEXP, SEXP lst_indexerSEXP, SEXP lst_cpp_objectsSEXP, SEXP lst_metadataSEXP) {
329
+ BEGIN_RCPP
330
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
331
+ Rcpp::traits::input_parameter< SEXP >::type lst_indexer(lst_indexerSEXP);
332
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_cpp_objects(lst_cpp_objectsSEXP);
333
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_metadata(lst_metadataSEXP);
334
+ drop_reference_points(is_altrepped, lst_indexer, lst_cpp_objects, lst_metadata);
285
335
  return R_NilValue;
286
336
  END_RCPP
287
337
  }
288
338
  // subset_trees
289
- Rcpp::List subset_trees(SEXP model_R_ptr, SEXP imputer_R_ptr, SEXP indexer_R_ptr, bool is_extended, bool has_imputer, Rcpp::IntegerVector trees_take);
290
- RcppExport SEXP _isotree_subset_trees(SEXP model_R_ptrSEXP, SEXP imputer_R_ptrSEXP, SEXP indexer_R_ptrSEXP, SEXP is_extendedSEXP, SEXP has_imputerSEXP, SEXP trees_takeSEXP) {
339
+ Rcpp::List subset_trees(SEXP model_R_ptr, SEXP imputer_R_ptr, SEXP indexer_R_ptr, bool is_extended, bool is_altrepped, Rcpp::IntegerVector trees_take);
340
+ RcppExport SEXP _isotree_subset_trees(SEXP model_R_ptrSEXP, SEXP imputer_R_ptrSEXP, SEXP indexer_R_ptrSEXP, SEXP is_extendedSEXP, SEXP is_altreppedSEXP, SEXP trees_takeSEXP) {
291
341
  BEGIN_RCPP
292
342
  Rcpp::RObject rcpp_result_gen;
293
343
  Rcpp::traits::input_parameter< SEXP >::type model_R_ptr(model_R_ptrSEXP);
294
344
  Rcpp::traits::input_parameter< SEXP >::type imputer_R_ptr(imputer_R_ptrSEXP);
295
345
  Rcpp::traits::input_parameter< SEXP >::type indexer_R_ptr(indexer_R_ptrSEXP);
296
346
  Rcpp::traits::input_parameter< bool >::type is_extended(is_extendedSEXP);
297
- Rcpp::traits::input_parameter< bool >::type has_imputer(has_imputerSEXP);
347
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
298
348
  Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type trees_take(trees_takeSEXP);
299
- rcpp_result_gen = Rcpp::wrap(subset_trees(model_R_ptr, imputer_R_ptr, indexer_R_ptr, is_extended, has_imputer, trees_take));
349
+ rcpp_result_gen = Rcpp::wrap(subset_trees(model_R_ptr, imputer_R_ptr, indexer_R_ptr, is_extended, is_altrepped, trees_take));
300
350
  return rcpp_result_gen;
301
351
  END_RCPP
302
352
  }
@@ -322,8 +372,8 @@ BEGIN_RCPP
322
372
  END_RCPP
323
373
  }
324
374
  // append_trees_from_other
325
- void append_trees_from_other(SEXP model_R_ptr, SEXP other_R_ptr, SEXP imp_R_ptr, SEXP oimp_R_ptr, SEXP ind_R_ptr, SEXP oind_R_ptr, bool is_extended, Rcpp::RawVector serialized_obj, Rcpp::RawVector serialized_imputer, Rcpp::RawVector serialized_indexer, Rcpp::List& model_cpp_obj_update, Rcpp::List& model_params_update);
326
- RcppExport SEXP _isotree_append_trees_from_other(SEXP model_R_ptrSEXP, SEXP other_R_ptrSEXP, SEXP imp_R_ptrSEXP, SEXP oimp_R_ptrSEXP, SEXP ind_R_ptrSEXP, SEXP oind_R_ptrSEXP, SEXP is_extendedSEXP, SEXP serialized_objSEXP, SEXP serialized_imputerSEXP, SEXP serialized_indexerSEXP, SEXP model_cpp_obj_updateSEXP, SEXP model_params_updateSEXP) {
375
+ void append_trees_from_other(SEXP model_R_ptr, SEXP other_R_ptr, SEXP imp_R_ptr, SEXP oimp_R_ptr, SEXP ind_R_ptr, SEXP oind_R_ptr, bool is_extended, Rcpp::RawVector serialized_obj, Rcpp::RawVector serialized_imputer, Rcpp::RawVector serialized_indexer, Rcpp::List& model_cpp_obj_update, Rcpp::List& model_params_update, bool is_altrepped);
376
+ RcppExport SEXP _isotree_append_trees_from_other(SEXP model_R_ptrSEXP, SEXP other_R_ptrSEXP, SEXP imp_R_ptrSEXP, SEXP oimp_R_ptrSEXP, SEXP ind_R_ptrSEXP, SEXP oind_R_ptrSEXP, SEXP is_extendedSEXP, SEXP serialized_objSEXP, SEXP serialized_imputerSEXP, SEXP serialized_indexerSEXP, SEXP model_cpp_obj_updateSEXP, SEXP model_params_updateSEXP, SEXP is_altreppedSEXP) {
327
377
  BEGIN_RCPP
328
378
  Rcpp::traits::input_parameter< SEXP >::type model_R_ptr(model_R_ptrSEXP);
329
379
  Rcpp::traits::input_parameter< SEXP >::type other_R_ptr(other_R_ptrSEXP);
@@ -337,7 +387,8 @@ BEGIN_RCPP
337
387
  Rcpp::traits::input_parameter< Rcpp::RawVector >::type serialized_indexer(serialized_indexerSEXP);
338
388
  Rcpp::traits::input_parameter< Rcpp::List& >::type model_cpp_obj_update(model_cpp_obj_updateSEXP);
339
389
  Rcpp::traits::input_parameter< Rcpp::List& >::type model_params_update(model_params_updateSEXP);
340
- append_trees_from_other(model_R_ptr, other_R_ptr, imp_R_ptr, oimp_R_ptr, ind_R_ptr, oind_R_ptr, is_extended, serialized_obj, serialized_imputer, serialized_indexer, model_cpp_obj_update, model_params_update);
390
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
391
+ append_trees_from_other(model_R_ptr, other_R_ptr, imp_R_ptr, oimp_R_ptr, ind_R_ptr, oind_R_ptr, is_extended, serialized_obj, serialized_imputer, serialized_indexer, model_cpp_obj_update, model_params_update, is_altrepped);
341
392
  return R_NilValue;
342
393
  END_RCPP
343
394
  }
@@ -377,28 +428,30 @@ BEGIN_RCPP
377
428
  END_RCPP
378
429
  }
379
430
  // copy_cpp_objects
380
- Rcpp::List copy_cpp_objects(SEXP model_R_ptr, bool is_extended, SEXP imp_R_ptr, bool has_imputer, SEXP ind_R_ptr);
381
- RcppExport SEXP _isotree_copy_cpp_objects(SEXP model_R_ptrSEXP, SEXP is_extendedSEXP, SEXP imp_R_ptrSEXP, SEXP has_imputerSEXP, SEXP ind_R_ptrSEXP) {
431
+ Rcpp::List copy_cpp_objects(SEXP model_R_ptr, bool is_extended, SEXP imp_R_ptr, SEXP ind_R_ptr, bool lazy_serialization);
432
+ RcppExport SEXP _isotree_copy_cpp_objects(SEXP model_R_ptrSEXP, SEXP is_extendedSEXP, SEXP imp_R_ptrSEXP, SEXP ind_R_ptrSEXP, SEXP lazy_serializationSEXP) {
382
433
  BEGIN_RCPP
383
434
  Rcpp::RObject rcpp_result_gen;
384
435
  Rcpp::traits::input_parameter< SEXP >::type model_R_ptr(model_R_ptrSEXP);
385
436
  Rcpp::traits::input_parameter< bool >::type is_extended(is_extendedSEXP);
386
437
  Rcpp::traits::input_parameter< SEXP >::type imp_R_ptr(imp_R_ptrSEXP);
387
- Rcpp::traits::input_parameter< bool >::type has_imputer(has_imputerSEXP);
388
438
  Rcpp::traits::input_parameter< SEXP >::type ind_R_ptr(ind_R_ptrSEXP);
389
- rcpp_result_gen = Rcpp::wrap(copy_cpp_objects(model_R_ptr, is_extended, imp_R_ptr, has_imputer, ind_R_ptr));
439
+ Rcpp::traits::input_parameter< bool >::type lazy_serialization(lazy_serializationSEXP);
440
+ rcpp_result_gen = Rcpp::wrap(copy_cpp_objects(model_R_ptr, is_extended, imp_R_ptr, ind_R_ptr, lazy_serialization));
390
441
  return rcpp_result_gen;
391
442
  END_RCPP
392
443
  }
393
444
  // build_tree_indices
394
- void build_tree_indices(Rcpp::List lst_modify, bool is_extended, bool with_distances, int nthreads);
395
- RcppExport SEXP _isotree_build_tree_indices(SEXP lst_modifySEXP, SEXP is_extendedSEXP, SEXP with_distancesSEXP, SEXP nthreadsSEXP) {
445
+ void build_tree_indices(Rcpp::List lst_cpp_objects, SEXP ptr_model, bool is_altrepped, bool is_extended, bool with_distances, int nthreads);
446
+ RcppExport SEXP _isotree_build_tree_indices(SEXP lst_cpp_objectsSEXP, SEXP ptr_modelSEXP, SEXP is_altreppedSEXP, SEXP is_extendedSEXP, SEXP with_distancesSEXP, SEXP nthreadsSEXP) {
396
447
  BEGIN_RCPP
397
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify(lst_modifySEXP);
448
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_cpp_objects(lst_cpp_objectsSEXP);
449
+ Rcpp::traits::input_parameter< SEXP >::type ptr_model(ptr_modelSEXP);
450
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
398
451
  Rcpp::traits::input_parameter< bool >::type is_extended(is_extendedSEXP);
399
452
  Rcpp::traits::input_parameter< bool >::type with_distances(with_distancesSEXP);
400
453
  Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
401
- build_tree_indices(lst_modify, is_extended, with_distances, nthreads);
454
+ build_tree_indices(lst_cpp_objects, ptr_model, is_altrepped, is_extended, with_distances, nthreads);
402
455
  return R_NilValue;
403
456
  END_RCPP
404
457
  }
@@ -413,11 +466,14 @@ BEGIN_RCPP
413
466
  END_RCPP
414
467
  }
415
468
  // set_reference_points
416
- void set_reference_points(Rcpp::List lst_modify, Rcpp::List lst_modify2, SEXP rnames, bool is_extended, Rcpp::NumericVector X_num, Rcpp::IntegerVector X_cat, Rcpp::NumericVector Xc, Rcpp::IntegerVector Xc_ind, Rcpp::IntegerVector Xc_indptr, size_t nrows, int nthreads, bool with_distances);
417
- RcppExport SEXP _isotree_set_reference_points(SEXP lst_modifySEXP, SEXP lst_modify2SEXP, SEXP rnamesSEXP, SEXP is_extendedSEXP, SEXP X_numSEXP, SEXP X_catSEXP, SEXP XcSEXP, SEXP Xc_indSEXP, SEXP Xc_indptrSEXP, SEXP nrowsSEXP, SEXP nthreadsSEXP, SEXP with_distancesSEXP) {
469
+ void set_reference_points(Rcpp::List lst_cpp_objects, SEXP ptr_model, SEXP ind_R_ptr, bool is_altrepped, Rcpp::List lst_metadata, SEXP rnames, bool is_extended, Rcpp::NumericVector X_num, Rcpp::IntegerVector X_cat, Rcpp::NumericVector Xc, Rcpp::IntegerVector Xc_ind, Rcpp::IntegerVector Xc_indptr, size_t nrows, int nthreads, bool with_distances);
470
+ RcppExport SEXP _isotree_set_reference_points(SEXP lst_cpp_objectsSEXP, SEXP ptr_modelSEXP, SEXP ind_R_ptrSEXP, SEXP is_altreppedSEXP, SEXP lst_metadataSEXP, SEXP rnamesSEXP, SEXP is_extendedSEXP, SEXP X_numSEXP, SEXP X_catSEXP, SEXP XcSEXP, SEXP Xc_indSEXP, SEXP Xc_indptrSEXP, SEXP nrowsSEXP, SEXP nthreadsSEXP, SEXP with_distancesSEXP) {
418
471
  BEGIN_RCPP
419
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify(lst_modifySEXP);
420
- Rcpp::traits::input_parameter< Rcpp::List >::type lst_modify2(lst_modify2SEXP);
472
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_cpp_objects(lst_cpp_objectsSEXP);
473
+ Rcpp::traits::input_parameter< SEXP >::type ptr_model(ptr_modelSEXP);
474
+ Rcpp::traits::input_parameter< SEXP >::type ind_R_ptr(ind_R_ptrSEXP);
475
+ Rcpp::traits::input_parameter< bool >::type is_altrepped(is_altreppedSEXP);
476
+ Rcpp::traits::input_parameter< Rcpp::List >::type lst_metadata(lst_metadataSEXP);
421
477
  Rcpp::traits::input_parameter< SEXP >::type rnames(rnamesSEXP);
422
478
  Rcpp::traits::input_parameter< bool >::type is_extended(is_extendedSEXP);
423
479
  Rcpp::traits::input_parameter< Rcpp::NumericVector >::type X_num(X_numSEXP);
@@ -428,7 +484,7 @@ BEGIN_RCPP
428
484
  Rcpp::traits::input_parameter< size_t >::type nrows(nrowsSEXP);
429
485
  Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
430
486
  Rcpp::traits::input_parameter< bool >::type with_distances(with_distancesSEXP);
431
- set_reference_points(lst_modify, lst_modify2, rnames, is_extended, X_num, X_cat, Xc, Xc_ind, Xc_indptr, nrows, nthreads, with_distances);
487
+ set_reference_points(lst_cpp_objects, ptr_model, ind_R_ptr, is_altrepped, lst_metadata, rnames, is_extended, X_num, X_cat, Xc, Xc_ind, Xc_indptr, nrows, nthreads, with_distances);
432
488
  return R_NilValue;
433
489
  END_RCPP
434
490
  }
@@ -452,12 +508,13 @@ BEGIN_RCPP
452
508
  return rcpp_result_gen;
453
509
  END_RCPP
454
510
  }
455
- // get_null_R_pointer
456
- SEXP get_null_R_pointer();
457
- RcppExport SEXP _isotree_get_null_R_pointer() {
511
+ // get_null_R_pointer_internal
512
+ SEXP get_null_R_pointer_internal(bool altrepped);
513
+ RcppExport SEXP _isotree_get_null_R_pointer_internal(SEXP altreppedSEXP) {
458
514
  BEGIN_RCPP
459
515
  Rcpp::RObject rcpp_result_gen;
460
- rcpp_result_gen = Rcpp::wrap(get_null_R_pointer());
516
+ Rcpp::traits::input_parameter< bool >::type altrepped(altreppedSEXP);
517
+ rcpp_result_gen = Rcpp::wrap(get_null_R_pointer_internal(altrepped));
461
518
  return rcpp_result_gen;
462
519
  END_RCPP
463
520
  }
@@ -477,13 +534,14 @@ BEGIN_RCPP
477
534
  END_RCPP
478
535
  }
479
536
  // deserialize_from_file
480
- Rcpp::List deserialize_from_file(Rcpp::CharacterVector fname);
481
- RcppExport SEXP _isotree_deserialize_from_file(SEXP fnameSEXP) {
537
+ Rcpp::List deserialize_from_file(Rcpp::CharacterVector fname, bool lazy_serialization);
538
+ RcppExport SEXP _isotree_deserialize_from_file(SEXP fnameSEXP, SEXP lazy_serializationSEXP) {
482
539
  BEGIN_RCPP
483
540
  Rcpp::RObject rcpp_result_gen;
484
541
  Rcpp::RNGScope rcpp_rngScope_gen;
485
542
  Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type fname(fnameSEXP);
486
- rcpp_result_gen = Rcpp::wrap(deserialize_from_file(fname));
543
+ Rcpp::traits::input_parameter< bool >::type lazy_serialization(lazy_serializationSEXP);
544
+ rcpp_result_gen = Rcpp::wrap(deserialize_from_file(fname, lazy_serialization));
487
545
  return rcpp_result_gen;
488
546
  END_RCPP
489
547
  }
@@ -728,30 +786,34 @@ static const R_CallMethodDef CallEntries[] = {
728
786
  {"_isotree_deserialize_ExtIsoForest", (DL_FUNC) &_isotree_deserialize_ExtIsoForest, 1},
729
787
  {"_isotree_deserialize_Imputer", (DL_FUNC) &_isotree_deserialize_Imputer, 1},
730
788
  {"_isotree_deserialize_Indexer", (DL_FUNC) &_isotree_deserialize_Indexer, 1},
731
- {"_isotree_check_null_ptr_model", (DL_FUNC) &_isotree_check_null_ptr_model, 1},
732
- {"_isotree_fit_model", (DL_FUNC) &_isotree_fit_model, 52},
733
- {"_isotree_fit_tree", (DL_FUNC) &_isotree_fit_tree, 53},
789
+ {"_isotree_serialize_IsoForest_from_ptr", (DL_FUNC) &_isotree_serialize_IsoForest_from_ptr, 1},
790
+ {"_isotree_serialize_ExtIsoForest_from_ptr", (DL_FUNC) &_isotree_serialize_ExtIsoForest_from_ptr, 1},
791
+ {"_isotree_serialize_Imputer_from_ptr", (DL_FUNC) &_isotree_serialize_Imputer_from_ptr, 1},
792
+ {"_isotree_serialize_Indexer_from_ptr", (DL_FUNC) &_isotree_serialize_Indexer_from_ptr, 1},
793
+ {"_isotree_check_null_ptr_model_internal", (DL_FUNC) &_isotree_check_null_ptr_model_internal, 1},
794
+ {"_isotree_fit_model", (DL_FUNC) &_isotree_fit_model, 53},
795
+ {"_isotree_fit_tree", (DL_FUNC) &_isotree_fit_tree, 54},
734
796
  {"_isotree_predict_iso", (DL_FUNC) &_isotree_predict_iso, 17},
735
797
  {"_isotree_dist_iso", (DL_FUNC) &_isotree_dist_iso, 20},
736
798
  {"_isotree_impute_iso", (DL_FUNC) &_isotree_impute_iso, 11},
737
- {"_isotree_drop_imputer", (DL_FUNC) &_isotree_drop_imputer, 2},
738
- {"_isotree_drop_indexer", (DL_FUNC) &_isotree_drop_indexer, 2},
739
- {"_isotree_drop_reference_points", (DL_FUNC) &_isotree_drop_reference_points, 2},
799
+ {"_isotree_drop_imputer", (DL_FUNC) &_isotree_drop_imputer, 5},
800
+ {"_isotree_drop_indexer", (DL_FUNC) &_isotree_drop_indexer, 5},
801
+ {"_isotree_drop_reference_points", (DL_FUNC) &_isotree_drop_reference_points, 4},
740
802
  {"_isotree_subset_trees", (DL_FUNC) &_isotree_subset_trees, 6},
741
803
  {"_isotree_inplace_set_to_zero", (DL_FUNC) &_isotree_inplace_set_to_zero, 1},
742
804
  {"_isotree_get_n_nodes", (DL_FUNC) &_isotree_get_n_nodes, 3},
743
- {"_isotree_append_trees_from_other", (DL_FUNC) &_isotree_append_trees_from_other, 12},
805
+ {"_isotree_append_trees_from_other", (DL_FUNC) &_isotree_append_trees_from_other, 13},
744
806
  {"_isotree_model_to_sql", (DL_FUNC) &_isotree_model_to_sql, 9},
745
807
  {"_isotree_model_to_sql_with_select_from", (DL_FUNC) &_isotree_model_to_sql_with_select_from, 8},
746
808
  {"_isotree_copy_cpp_objects", (DL_FUNC) &_isotree_copy_cpp_objects, 5},
747
- {"_isotree_build_tree_indices", (DL_FUNC) &_isotree_build_tree_indices, 4},
809
+ {"_isotree_build_tree_indices", (DL_FUNC) &_isotree_build_tree_indices, 6},
748
810
  {"_isotree_check_node_indexer_has_distances", (DL_FUNC) &_isotree_check_node_indexer_has_distances, 1},
749
- {"_isotree_set_reference_points", (DL_FUNC) &_isotree_set_reference_points, 12},
811
+ {"_isotree_set_reference_points", (DL_FUNC) &_isotree_set_reference_points, 15},
750
812
  {"_isotree_check_node_indexer_has_references", (DL_FUNC) &_isotree_check_node_indexer_has_references, 1},
751
813
  {"_isotree_get_num_references", (DL_FUNC) &_isotree_get_num_references, 1},
752
- {"_isotree_get_null_R_pointer", (DL_FUNC) &_isotree_get_null_R_pointer, 0},
814
+ {"_isotree_get_null_R_pointer_internal", (DL_FUNC) &_isotree_get_null_R_pointer_internal, 1},
753
815
  {"_isotree_serialize_to_file", (DL_FUNC) &_isotree_serialize_to_file, 6},
754
- {"_isotree_deserialize_from_file", (DL_FUNC) &_isotree_deserialize_from_file, 1},
816
+ {"_isotree_deserialize_from_file", (DL_FUNC) &_isotree_deserialize_from_file, 2},
755
817
  {"_isotree_call_sort_csc_indices", (DL_FUNC) &_isotree_call_sort_csc_indices, 3},
756
818
  {"_isotree_call_reconstruct_csr_sliced", (DL_FUNC) &_isotree_call_reconstruct_csr_sliced, 5},
757
819
  {"_isotree_call_reconstruct_csr_with_categ", (DL_FUNC) &_isotree_call_reconstruct_csr_with_categ, 11},
@@ -774,7 +836,9 @@ static const R_CallMethodDef CallEntries[] = {
774
836
  {NULL, NULL, 0}
775
837
  };
776
838
 
839
+ void init_altrepped_vectors(DllInfo* dll);
777
840
  RcppExport void R_init_isotree(DllInfo *dll) {
778
841
  R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
779
842
  R_useDynamicSymbols(dll, FALSE);
843
+ init_altrepped_vectors(dll);
780
844
  }