|
194 | 194 | # To ensure results are reproducible across runs, you can pass the |
195 | 195 | # ``random_state`` parameter, causing the random number generator to produce |
196 | 196 | # the same results every time you execute the function. This may come in handy |
197 | | -# e.g. in situations where you discover a problem with the data while working |
| 197 | +# in situations where you discover a problem with the data while working |
198 | 198 | # with the anonymized dataset, fix the issue in the original dataset, and |
199 | 199 | # run anonymization again. |
200 | 200 | # |
|
203 | 203 | # in a dataset with multiple subjects will the effects of randomly-picked IDs |
204 | 204 | # become apparent.) |
205 | 205 | # |
| 206 | +# A good random seed is truly random. Avoid using random seeds from popular |
| 207 | +# culture, like "42", or "1337". To obtain a truly random seed, you can paste |
| 208 | +# the following into your console: |
| 209 | +# ``python -c "import secrets; print(secrets.randbits(31))"`` |
| 210 | +# Here, 31 bits correspond to the maximum seed "size" that the the legacy |
| 211 | +# ``RandomState`` by NumPy, which many scientific libraries still rely on, |
| 212 | +# can accept. For more information, see also this blog post on |
| 213 | +# `NumPy RNG best practices <https://blog.scientific-python.org/numpy/numpy-rng/>`_. |
| 214 | +# |
206 | 215 | # .. note:: |
207 | 216 | # Passing ``random_state`` merely guarantees that subject IDs and time shift |
208 | 217 | # remain the same across anonymization runs if the original dataset |
|
218 | 227 | bids_root_in=bids_root, |
219 | 228 | bids_root_out=bids_root_anon, |
220 | 229 | datatypes="meg", |
221 | | - random_state=42, |
| 230 | + random_state=293201004, |
222 | 231 | ) |
223 | 232 | print_dir_tree(bids_root_anon) |
0 commit comments