Skip to content

Instantly share code, notes, and snippets.

@JohannesBuchner
Created February 11, 2015 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesBuchner/f05bf324a6d6d7e035e7 to your computer and use it in GitHub Desktop.
Save JohannesBuchner/f05bf324a6d6d7e035e7 to your computer and use it in GitHub Desktop.
def generateTuple():
if numpy.random.uniform() > 0.05:
# generate from normal data set, e.g. normal distribution around some values -- here, a line
k = 1.16
d = 8.9
x = numpy.random.uniform(6, 12)
y = k * (x - 11) + d
return numpy.random.norm(x, 1), numpy.random.norm(y, 3)
else:
# generate from outlier distribution, e.g. uniform distribution over full parameter space
return numpy.random.uniform(6, 10), numpy.random.uniform(6, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment