# Isolation Forests?

**URL:** <https://discourse.julialang.org/t/isolation-forests/77859>\
**Category:** Machine Learning\
**Tags:** question\
**Created:** [March 14, 2022, 11:33am UTC](https://discourse.julialang.org/t/isolation-forests/77859 "2022-03-14T11:33:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [March 14, 2022, 11:33am UTC](https://discourse.julialang.org/t/isolation-forests/77859/1 "2022-03-14T11:33:58Z")

</div>

Has anyone found or implemented a routine for Isolation Forests in Julia?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [March 14, 2022, 5:17pm UTC](https://discourse.julialang.org/t/isolation-forests/77859/2 "2022-03-14T17:17:02Z")

</div>

[[ANN] OutlierDetection.jl - Outlier / Anomaly Detection Ecosystem](https://discourse.julialang.org/t/ann-outlierdetection-jl-outlier-anomaly-detection-ecosystem/77422) may have what you want. The [README](https://github.com/OutlierDetectionJL/OutlierDetection.jl#algorithms-also-known-as-detectors) mentions Isolation Forests.

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [March 14, 2022, 6:18pm UTC](https://discourse.julialang.org/t/isolation-forests/77859/3 "2022-03-14T18:18:09Z")

</div>

Thank you very much - I will see if I can implement the PyCall version (and play with the other methods). I hope someone implements it in Julia!

---

<div class="post-metadata">

**Author:** ![davnn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davnn/32/33433_2.png) [@davnn](https://discourse.julialang.org/u/davnn)\
**Post date:** [March 17, 2022, 7:59am UTC](https://discourse.julialang.org/t/isolation-forests/77859/4 "2022-03-17T07:59:24Z")

</div>

By the way… [LibIsolationForest](https://github.com/msimms/LibIsolationForest) contains a pure Julia implementation that should be fairly straight-forward to port to OutlierDetection.jl. I would happily support you if you would like to port it 🙂

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [March 17, 2022, 12:03pm UTC](https://discourse.julialang.org/t/isolation-forests/77859/5 "2022-03-17T12:03:57Z")

</div>

Thanks so much, that is the kind of thing I was hoping for.

I looked at your test script and it looks interesting but quite involved… I think what would be most useful for someone like me who is just playing with a variety of methods (and also for my students) would be a minimal example of how to run and apply your model.  
Thanks for your package (and test script), though! And also for what may be possible by way of my suggestion.

---

<div class="post-metadata">

**Author:** ![davnn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davnn/32/33433_2.png) [@davnn](https://discourse.julialang.org/u/davnn)\
**Post date:** [March 19, 2022, 8:51pm UTC](https://discourse.julialang.org/t/isolation-forests/77859/6 "2022-03-19T20:51:30Z")

</div>

I took a first stab at integrating the isolation forest implementation with [OutlierDetection.jl](https://github.com/OutlierDetectionJL/OutlierDetection.jl/). Have a look at the discussion at [https://github.com/msimms/LibIsolationForest/issues/8](https://github.com/msimms/LibIsolationForest/issues/8) to follow the implementation progress and possibly contribute.
