Generate a dataset from a linear function with AWGN (Added White Gaussian Noise).
It can be multidimensional if ‘slope’ is a vector. If flat is True (in 1 dimesion) generate equally spaces samples instead of random ones. This is useful for the test phase.