0
$\begingroup$

I'm building a tensorflow model to detect anomalies in an electricity smart meter data and I'm using UK-DALE Dataset. How can I introduce anomalies in the data so I can test the model?

$\endgroup$

1 Answer 1

0
$\begingroup$

Anomalies usually mean datapoints that are not making sense, so you can just insert random numbers between a given range.

Generating 10 random numbers:

import random
randomlist = []
for i in range(0,10):
    n = random.randint(1,30)
    randomlist.append(n)
print(randomlist)

Generate 10 random numbers as part of some timeseries:

np.random.seed(2019)
N = 10
rng = pd.date_range('2019-01-01', freq='MS', periods=N)
df = pd.DataFrame(np.random.rand(N, 1), columns=  ['readings'], index=rng)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.