Netdata Community

Feedback or suggestion on: Anomaly detection with Netdata

Hi, I just tried to setup the anomaly detection plugin for netdata on an rasperry pi 4 with ubuntu 20.04.3 LTS installed. Active python version is 3.8.10

Unfortunately I already got stuck while installing the neccesary python libraries. It started while building the numba module (Error, no numby module found) and continued while building the llvmlite module. The netdata error log showed ‘no numba module found’ and ‘no pyod module found’. I tried to work around by installing these modules manually. But then it boiled down to “ValueError(‘Sklearn version error’)”. Now I am a bit clueless. Perhaps I am missing some prerequisites that are supposed to already exist on the system, but aren’t mentioned in any tutorial? Or would I need to install different versions of these libraries?

Did you follow the instructions at Anomaly detection with Netdata | Learn Netdata ? Because there is a step there to install some packages manually. (pip3 install command)

Yes, that was the initial step and what I meant when writing ‘… got stuck while installing the neccesary python libraries …’

But the whole ‘pip3 install’ process failed several times during install and building. Thats why I obviously ended up with the modules ‘numba’ and ‘pyod’ missing. The building of the numba module failed because it couldn’t find ‘numby’ and ‘llvmlight’ and the building of the pyod module failed possibly as a consequence of that.

Hello @devrand welcome! And thanks for your interest in Anomaly Detection! :slight_smile:

I created this guide a while back when setting it up on my own Pi - there is one little trick/difference with LLVM and how to install the pip packages the collector depends on:

I believe it is related to fact that llvm not on PI by default so need to first install that and then when doing the pip step need to tell pip where to find the llvm.

Have a go at the steps in the guide above and let me know how you get on.

p.s. we are quite close to merging a more native c++ based anomaly detection capability direclty into the netdata agent that will work on Pi as well. Just as an fyi of something that might be hearing more of if of interest to you. https://github.com/netdata/netdata/pull/11548

1 Like

p.s. added a note to the docs to try make link to Rasberry Pi a little more clearer.

1 Like

Yep, thank you very much andrewm, that was the missing information. Wonder how I missed that tutorial.

Got it running now. Need to play with it for a little while I think. I’m happy :slight_smile:

Regarding custom models: you can choose your metrics for them in the ‘dimensions’ string. But is there a way to give an individual weight (or relevance) to each included metric? Or are there plans to add such a feature?

great - glad you got sorted. Would love some feedback and examples where its useful and others where its more like false alarms or just not up to scratch.

there is not really any way to give a weighting for each individual metric - one sort of hacky way which we could explore would be to just include the same metric twice to give it essentially 2 times the weight. But this is kind of horrible. Would be much better to have a cleaner way to weight features.

We use a subset of the models from PyOD here: All Models — pyod 0.9.3 documentation

From a quick look i don’t think any of them have this capability built into them.

Another approach could be to build a custom model for just one dim and then have some sort of weighting on the models themselves in some way.

Will think a bit and see if any existing AD approach out there that have some capability like this.

1 Like