scikitplot.random#
Random Number Generation (Numpy-Like Generator) [1] [2] [3].
Use default_rng() to create a Generator and call its methods.
References
Marsaglia, G. (1999). “Random Number Generators.” Journal of Modern Applied Statistical Methods, 2(1), 2-13.
Jones, D. “Good Practice in (Pseudo) Random Number Generation for Bioinformatics Applications.” https://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf
NumPy Development Team. “Random Generator.” https://numpy.org/doc/stable/reference/random/generator.html
Examples
>>> from scikitplot.random import default_rng, kiss_context
>>> rng = default_rng(42)
>>> data = rng.random(1000)
Context manager
>>> with default_rng(42) as rng:
... data = rng.random(1000)
>>>
>>> with kiss_context(42) as rng:
... data = rng.random(1000)
User guide. See the Random section for further details.
Random Number Generation (Numpy-Like Generator).#
User guide. See the Random section for further details.
32-bit KISS RNG with complete serialization support. |
|
Low-level 64-bit KISS RNG with context manager support. |
|
Factory function for auto-detecting 32-bit vs 64-bit RNG. |
|
Seed sequence compatible with numpy.random.SeedSequence. |
|
NumPy-compatible BitGenerator using KISS algorithm with complete serialization. |
|
High-level random number generator using KISS algorithm. |
|
NumPy RandomState-compatible interface with complete serialization. |
|
Create default KISS random number generator. |
|
Context manager for temporary RNG. |
KissGenerator Distribution Methods#
User guide. See the Random section for further details.
Random sample from array. |
|
Random integers in [low, high) or [low, high]. |
|
Normal distribution (Box-Muller transform). |
|
Randomly permute sequence or return permuted range. |
|
Random floats in [0, 1). |
|
Shuffle array in-place (Fisher-Yates algorithm). |
|
Uniform distribution in [low, high). |