python - Uniformly distributed data in d dimensions -


how can generate uniformly distributed [-1,1]^d data in python? e.g. d dimension 10.

i know how generate uniformly distributed data np.random.randn(n) dimension thing confused me lot.

assuming independence of individual coordinates, following generate random point in [-1, 1)^d

np.random.random(d) * 2 - 1 

the following generate n observations, each row observation

np.random.random((n, d)) * 2 - 1 

Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -