# Implementing one-class SVM for Novelty Detection

**URL:** https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357
**Category:** Statistics
**Tags:** question, package
**Created:** [January 8, 2017, 7:54pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357 "2017-01-08T19:54:37Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![KrishnaKanhaiya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krishnakanhaiya/32/443_2.png) [@KrishnaKanhaiya](https://discourse.julialang.org/u/KrishnaKanhaiya)
#### Post date: [January 8, 2017, 7:54pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/1 "2017-01-08T19:54:37Z")

</div>

Hi,  
I want to implement one-class SVM in Julia(SVM.jl) very similar to scikit-learn in python ([here](http://scikit-learn.org/stable/modules/svm.html#svm-outlier-detection)).

I see that SVM.jl is unmaintained and will be removed from the metadata shortly. Is it going to be removed for sure? What would be the alternative to SVM.jl?

---

<div class="post-metadata">

### Author: ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)
#### Post date: [January 8, 2017, 8:57pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/2 "2017-01-08T20:57:07Z")

</div>

Probably the best course of action is to just go for it and create a new package if the topic is something that interests you. There certainly is room for it and I am sure people would find it useful if it is well made

---

<div class="post-metadata">

### Author: ![tbreloff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbreloff/32/68_2.png) [@tbreloff](https://discourse.julialang.org/u/tbreloff)
#### Post date: [January 8, 2017, 10:52pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/3 "2017-01-08T22:52:50Z")

</div>

@Evizero any reason you didn’t mention your  
[GitHub - Evizero/KSVM.jl: Support Vector Machines (SVM) in pure Julia](https://github.com/Evizero/KSVM.jl)?

---

<div class="post-metadata">

### Author: ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)
#### Post date: [January 8, 2017, 11:11pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/4 "2017-01-08T23:11:02Z")

</div>

Yes. I don’t want to discourage innovation because of the existence of a half finished package. At this state it should not be considered as relevant to anyone who is interested into tackling SVMs themselves.

I started KSVM with a very particular vision of what it should be, but quickly discovered that I need some other building blocks first in order to realize my plan the way I want to. Some parts are almost there (such as LossFunctions.jl), some I still need to flesh out. Basically I am following a bottom up approach that has very little “visible” progress, so I try to keep quiet unless I have something concrete to report. I only have my spare time available for this, but I will get there eventually.

---

<div class="post-metadata">

### Author: ![KrishnaKanhaiya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krishnakanhaiya/32/443_2.png) [@KrishnaKanhaiya](https://discourse.julialang.org/u/KrishnaKanhaiya)
#### Post date: [January 10, 2017, 10:00pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/5 "2017-01-10T22:00:41Z")

</div>

Hi,  
After a little bit of research, I found that scikit-learn’s [one class SVM](http://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html#sklearn.svm.OneClassSVM) is implemented on the top of the famous LibSVM implementation of svm.

I think LIBSVM.jl is the package that I have been looking for. Certainly, native implementation is on my bucket list too 🙂

---

<div class="post-metadata">

### Author: ![KrishnaKanhaiya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krishnakanhaiya/32/443_2.png) [@KrishnaKanhaiya](https://discourse.julialang.org/u/KrishnaKanhaiya)
#### Post date: [January 10, 2017, 10:34pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/6 "2017-01-10T22:34:18Z")

</div>

Just curious, why is SVM.jl no longer maintained? What is the scope of improvement so that we can have it registered again in METADATA?  
I would be happy to volunteer for it.

---

<div class="post-metadata">

### Author: ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)
#### Post date: [January 10, 2017, 11:41pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/7 "2017-01-10T23:41:57Z")

</div>

SVM.jl never really worked very well. I wouldn’t bother trying to restore it.

---

<div class="post-metadata">

### Author: ![mpastell](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpastell/32/350_2.png) [@mpastell](https://discourse.julialang.org/u/mpastell)
#### Post date: [May 2, 2017, 12:26pm UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/8 "2017-05-02T12:26:52Z")

</div>

[LIBSVM.jl](https://github.com/mpastell/LIBSVM.jl) has now a new release v0.1.0 with added one-class SVM support and several other fixes.

---

<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: [July 27, 2020, 8:43am UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/9 "2020-07-27T08:43:32Z")

</div>

Has there been any further activity on this? I have tested the One-Class LIBSVM.jl implementation on simple test examples and it gives wrong answers (see my GitHub post on the LIBSVM.jl page). I have started a new query on Discourse about it because this thread is so old (also, I had missed this thread on my earlier searches).

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [July 28, 2020, 12:14am UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/10 "2020-07-28T00:14:22Z")

</div>

Hi, I’ve been meaning to look into SVMs, and related, myself. Maybe you can use SciKitLearn through the Julia wrapper or some of these other libraries?

[https://github.com/innerlee/LIBLINEAR.jl](https://github.com/innerlee/LIBLINEAR.jl)

[https://jump.dev/Convex.jl/v0.13.2/examples/general\_examples/svm/](https://jump.dev/Convex.jl/v0.13.2/examples/general_examples/svm/)

---

<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: [July 28, 2020, 9:29am UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/11 "2020-07-28T09:29:50Z")

</div>

Hi. The last Convex link is very helpful and interesting indeed.  
Thank you so much for that.

ScikitLearn apparenly uses LIBSVM and is just an additional interface. However, someone helpfully pointed out that by adjusting the ‘nu’ parameter away from the default value (a blanket value set mainly for other SV types) one can get good performance.

Regarding the LIBINEAR it looks like it is still in development, but will be interesting as it develops.

Thanks!

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [July 28, 2020, 10:58am UTC](https://discourse.julialang.org/t/implementing-one-class-svm-for-novelty-detection/1357/12 "2020-07-28T10:58:50Z")

</div>

There’s also [https://github.com/theogf/AugmentedGaussianProcesses.jl](https://github.com/theogf/AugmentedGaussianProcesses.jl) (more general package than BayesianSVM.jl).
