Open ankane opened 4 years ago
export_model, import_model
It is the feature that I want to use. Maybe serialize_ext_isoforest and deserialize_ext_isoforest must be wrapped.
diff --git a/ext/isotree/ext.cpp b/ext/isotree/ext.cpp
index 62a37a8..bc2ee11 100644
--- a/ext/isotree/ext.cpp
+++ b/ext/isotree/ext.cpp
@@ -1,4 +1,5 @@
// isotree
+#define _ENABLE_CEREAL
#include <isotree.hpp>
// rice
@@ -259,5 +260,18 @@ void Init_ext()
ret.push(outlier_scores[i]);
}
return ret;
+ })
+ .define_singleton_method(
+ "serialize_iforest",
+ *[](ExtIsoForest& iso, String path) {
+ serialize_ext_isoforest(iso, path.c_str());
+ return iso;
+ })
+ .define_singleton_method(
+ "deserialize_iforest",
+ *[](String path) {
+ ExtIsoForest iso;
+ deserialize_ext_isoforest(iso, path.c_str());
+ return iso;
});
}
Hey @kenhys, there's now a very basic version in the export_model branch.
Edit: Think it's in a good place now, so merged to master.
Thanks, I'll try it.
Ideas
update-0.5
branchIsolationForest
initializerappend_trees
,num_nodes
,partial_fit
,predict_distance
,transform