Detecting abnormal 'cat' behaviour via Supervised Learning A few work colleagues and I were looking through a recently replaced 'cat', we had in the workplace. For those of you which are curious, the 'cat' in this context, refers to a specific type of pump known as a cat pump. It's affectionally called the 'kitty' as we only have one of these pumps. 

After one routine inspection, I noticed a number of periods where kitty wasn't performing well. This is labelled in the dataset as Cat Anomaly. 

(Accessible from here if anyone wishes to analyse further: 

https://drive.google.com/open?id=1e0OhzhaSZP9_A3QdaK9-BvWXbRPZacED)

This is what it looks like when it is abnormal:

Essentially, it looks similar to a sinusoidal pattern and is slightly curved.
I also noted that the cluster of points seem to be quite tight when it is an abnormal state. 



Using Python's Sklearn Libraries and some good ol fashioned signal processing, I decided to remove some of the noisy clusters so I can see what the signal looks like 'without' the noise. To do this, I have performed a Savitzy-Golay Filter on the data, which has smoothed this out as per below. 



I have then used a feature to subtract the values from the 'normal' cat values - 'smoothed' cat values which gives me a rough indication of when the 'clusters' appear. 

This has worked acceptably (~90% accuracy) and I can pick up abnormalities to an extent when I feed this feature into my random forest model, but I feel the 'cluster' approach I have used is very clunky and there are much better ways to capture the 'noisiness' of the cat signal as a variable. 



So now I'm looking for a better way of recognizing and separating 'abnormal' cat behaviour.

So, as a better feature or variable to capture 'noisy' clusters, does anyone else have any ideas on improvements on how to capture this?
At what resolution are you performing you classification? At sample level?

If so, what does your baseline model look like? Did you try for example just feeding the last 5-10 raw samples as features and see what accuracy you get that way?

Also, you could try seeing what happens if you do some kind of "smoothing" at the output - e.g. if you assume that one "good" sample, surrounded by 10 "bad" samples should be reclassified as "bad" also -- because the system cannot jump so quickly between normal and faulty modes of operation.

Finally (or should be firstly), what is the accuracy that is actually necessary for your model to be useful in practice?