Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect outliers in the standby consumption #148

Open
JrtPec opened this issue Oct 8, 2016 · 6 comments
Open

Detect outliers in the standby consumption #148

JrtPec opened this issue Oct 8, 2016 · 6 comments

Comments

@JrtPec
Copy link
Member

JrtPec commented Oct 8, 2016

We can easily develop an algorithm to detect these kind of outliers (I'm thinking a ransac regressor)
standby_vertical_a7d523e79909ad098bccc337c5da84a0

@GMathyssen
Copy link
Member

Can I use the scikit-learn library for it?

@JrtPec
Copy link
Member Author

JrtPec commented Dec 6, 2016

Yes! I was thinking about a RANSAC-algorithm.

I have implemented it before, so I might have some code snippets that could be used to start.

@JrtPec
Copy link
Member Author

JrtPec commented Dec 7, 2016

This should get you started!

import numpy as np
from sklearn import linear_model

x = []  # list with x-values
y = []  # list with y-values
# make sure that x and y have the same size!

model_ransac = linear_model.RANSACRegressor(linear_model.LinearRegression())
model_ransac.fit(x, y)

# use inlier_mask_ to get a boolean series of the inliers
inliers = model_ransac.inlier_mask_
outliers = np.logical_not(inliers)

You can also use model_ransac.predict() to calculate expected values!

My expectation is that if you would apply this method to the image posted above, those two outlying red dot's would be detected pretty easily.

@Ryton
Copy link
Contributor

Ryton commented Dec 9, 2016

@saroele JrtPec: Maybe also kick out FL03001550 from the analysis? This seriously skews the analysis/mean. I'm convinced this is not a residential building (an office?) as it has a night/weekend consumption of 5kW and week-day consumption of 15-20kW.

https://opengrid.be/sensor/565de0a7dc64d8370aa321491217b85f

@saroele
Copy link
Member

saroele commented Dec 9, 2016 via email

@JrtPec
Copy link
Member Author

JrtPec commented Dec 12, 2016

It wouldn't be too hard to add a "building type" argument to the sites in the houseprint, both in the GDocs file as in the code + parser. I would like to see what naming conventions SAREF uses, but other than that it's pretty straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants