I have a numpy array full of customer spending data:
x = np.array([5000,5500,6250,4800,3950,5800,5500,800,1200,900,500,400,300,200,3100])
Above, you can see that before index 7 the customer spends much more money than he does after index 7. I am looking to find an abnormality such as index 7 by looking sequentially at the data and want to identify if the split data set has a significant change (i.e. spending habits have changed or remained the same after the first abnormality).
So, 800 would be detected and there would be two lists:
l1 = [5000,5500,6250,4800,3950,5800,5500]
l2 = [1200,900,500,400,300,200,3100]
Here, a similarity measure needs to be upon comparison such to see the similarity or difference of l1 and l2.
Are there any useful sklearn functions for this? I know I can look at means, rolling std's etc, and set thresholds for this but was looking for a more statistical approach possibly something in a more statistical/machine learning python library.