diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2021-01-14 23:10:42 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2021-01-14 23:10:42 +0000 |
| commit | c3dc92773b34ba542f5da485c3848c7ffc758763 (patch) | |
| tree | f85c6c4bafeeff160b85b681304c53d9fb25641a | |
| parent | Restrict the deploy build to tagged commits (diff) | |
| download | SyncRNG-c3dc92773b34ba542f5da485c3848c7ffc758763.tar.gz SyncRNG-c3dc92773b34ba542f5da485c3848c7ffc758763.zip | |
Update readme and symlink to python package
| -rw-r--r-- | README.md | 28 | ||||
| l--------- | python/README.md | 1 |
2 files changed, 21 insertions, 8 deletions
@@ -1,17 +1,24 @@ # SyncRNG -A synchronized Tausworthe RNG usable in R and Python. +[](https://github.com/GjjvdBurg/SyncRNG/actions) +[](https://cran.r-project.org/web/packages/SyncRNG/index.html) +[](https://cran.r-project.org/web/packages/SyncRNG/index.html) +[](https://pypi.org/project/SyncRNG) +[](https://pepy.tech/project/SyncRNG) + +Generate the same random numbers in R and Python. ## Why? This program was created because it was desired to have the same random numbers in both R and Python programs. Although both languages implement a -Mersenne-Twister RNG, the implementations are so different that it is not -possible to get the same random numbers with the same seed. +Mersenne-Twister random number generator (RNG), the implementations are so +different that it is not possible to get the same random numbers, even with +the same seed. -SyncRNG is a Tausworthe RNG implemented in ``syncrng.c``, and linked to both R -and Python. Since both use the same underlying C code, the random numbers will -be the same in both languages, provided the same seed is used. +SyncRNG is a "Tausworthe" RNG implemented in C and linked to both R and +Python. Since both use the same underlying C code, the random numbers will be +the same in both languages when the same seed is used. You can read more about my motivations for creating this [here](https://gertjanvandenburg.com/blog/syncrng/). @@ -81,6 +88,10 @@ class: 3. ``randbelow(n)``: generate a random integer below a given integer ``n``. 4. ``shuffle(x)``: generate a permutation of a given list of numbers ``x``. +Functionality is deliberately kept minimal to make maintaining this library +easier. It is straightforward to build more advanced applications on the +existing methods, as the following example shows. + ### Creating the same train/test splits A common use case for this package is to create the same train and test splits @@ -162,7 +173,6 @@ for trainidx, testidx in kf: X_test = X[testidx, :] # continue using X_train and X_test here - ``` ## Notes @@ -176,4 +186,6 @@ number generator for cryptographic applications. If you have questions, comments, or suggestions about SyncRNG or you encounter a problem, please open an issue [on GitHub](https://github.com/GjjvdBurg/SyncRNG/). Please don't hesitate to -contact me, you're helping to make this project better for everyone! +contact me, you're helping to make this project better for everyone! If you +prefer not to use Github you can email me at ``gertjanvandenburg at gmail dot +com``. diff --git a/python/README.md b/python/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/python/README.md @@ -0,0 +1 @@ +../README.md
\ No newline at end of file |
