-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Cython USPORF and outlier detection example #349
base: staging
Are you sure you want to change the base?
Conversation
Deploy preview for rerf ready! Built with commit 16aaecd |
Thanks for the PR. A few questions from a cursory look. 1) Is there a reason you chose to go the cython route as opposed to implementing the BIC split criteria in C++ and then writing python bindings ? Similarly with the tree structures, it would be much more maintainable if a python wrapper (eg using pybind11) were used instead of a cython implementation. If you have chosen to go the python route for efficiency reasons, I would like to see a benchmark comparison. 2) Could you please write some tests for this ? 3) Please make it pass the travis build. |
|
Our goal for this package is not sklearn compliance but scalability and efficiency. Scikit-learn's "cython only" rules are primarily for ease of maintenance. Our goal for RerF was to build a scalable random forest implementation (i.e similar to XGBoost but for random forests) especially for low latency predictions. We did try to port some of the prediction functions to cython in an attempt to make it sklearn compliant but we failed in that we weren't able to achieve low latencies because cython wasn't the appropriate programming environment for it (i.e it lacked some of the low level features we used such as prefetching). |
What do you think should be the most reasonable step if my original goal is to call tree structure in python?
|
Issues: #348
After a conversation with @MrAE, I plan to create a USPORF code that can extract a tree structure in python
Attached files
Examples:
SPORF/docs/demos/URerF/3d_usporf_outlier_detection.ipynb
: Show the outlier detection comparison of Isolation forest (IF) and USPORF (2 methods). The first USPORF uses the affinity matrix. The second USPORF use pathlength function of IFModules:
SPORF/Python/rerf/pycy_usporf.py
: main module for the second USPORF methodSPORF/Python/src/cy_usporf.pyx
: helppycy_usporf.py
do some computation part, such as Fast-BIC score.SPORF/Python/src/setup.py
: compile and generate module fromcy_usporf.pyx
Figures