ext/isotree/ext.cpp in isotree-0.1.4 vs ext/isotree/ext.cpp in isotree-0.1.5

- old
+ new

@@ -149,10 +149,11 @@ double* output_depths = NULL; bool standardize_depth = false; double* col_weights = NULL; Imputer *imputer = NULL; bool impute_at_fit = false; + bool handle_interrupt = false; fit_iforest( NULL, &iso, numeric_data, @@ -195,10 +196,11 @@ min_imp_obs, depth_imp, weigh_imp_rows, impute_at_fit, random_seed, + handle_interrupt, nthreads ); return iso; }) @@ -255,7 +257,31 @@ Array ret; for (size_t i = 0; i < outlier_scores.size(); i++) { ret.push(outlier_scores[i]); } return ret; + }) + .define_singleton_method( + "serialize_ext_isoforest", + *[](ExtIsoForest& iso, String path) { + #ifdef _MSC_VER + // TODO convert to wchar_t + throw std::runtime_error("Not supported on Windows yet"); + #else + serialize_ext_isoforest(iso, path.c_str()); + #endif + }) + .define_singleton_method( + "deserialize_ext_isoforest", + *[](String path) { + ExtIsoForest iso; + + #ifdef _MSC_VER + // TODO convert to wchar_t + throw std::runtime_error("Not supported on Windows yet"); + #else + deserialize_ext_isoforest(iso, path.c_str()); + #endif + + return iso; }); }