org.eclipse.january.dataset

## Class Random

- java.lang.Object
- - org.eclipse.january.dataset.Random

-     public class Random
      extends Object

  Class to hold methods to create random datasets Emulates numpy.random

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Random()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DoubleDataset` | `exponential(double beta, int... shape)`
    `static ILazyDataset` | `lazyRand(int... shape)`
    `static ILazyDataset` | `lazyRand(int dtype, String name, int... shape)` Deprecated. Use `lazyRand(String, Class, int...)`
    `static ILazyDataset` | `lazyRand(String name, Class<? extends Dataset> clazz, int... shape)`
    `static ILazyDataset` | `lazyRand(String name, int... shape)`
    `static IntegerDataset` | `poisson(double lam, int... shape)`
    `static DoubleDataset` | `rand(double low, double high, int... shape)`
    `static DoubleDataset` | `rand(int... shape)`
    `static IntegerDataset` | `randint(int low, int high, int[] shape)`
    `static DoubleDataset` | `randn(double mean, double std, int... shape)`
    `static DoubleDataset` | `randn(int... shape)`
    `static IntegerDataset` | `random_integers(int low, int high, int[] shape)`
    `static void` | `seed(int seed)`
    `static void` | `seed(int[] seed)`
    `static void` | `seed(long seed)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Random

          public Random()

  - ### Method Detail

    - #### seed

          public static void seed(int seed)

      Parameters:
        `seed` - value for generator

    - #### seed

          public static void seed(int[] seed)

      Parameters:
        `seed` - values for generator

    - #### seed

          public static void seed(long seed)

      Parameters:
        `seed` - value for generator

    - #### rand

          public static DoubleDataset rand(int... shape)

      Parameters:
        `shape` - output shape
      Returns:
        an array of values sampled from a uniform distribution between 0 (inclusive) and 1 (exclusive)

    - #### rand

          public static DoubleDataset rand(double low,
                                           double high,
                                           int... shape)

      Parameters:
        `low` - lower exclusive bound
        `high` - upper exclusive bound
        `shape` - output shape
      Returns:
        an array of values sampled from a uniform distribution between low and high (both exclusive)

    - #### randn

          public static DoubleDataset randn(int... shape)

      Parameters:
        `shape` - output shape
      Returns:
        an array of values sampled from a Gaussian distribution with mean 0 and variance 1 (The term Gaussian here is a description of a shape of data taken from the mathematician of the same name Carl Friedrich Gauss http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss born in 1777.)

    - #### randn

          public static DoubleDataset randn(double mean,
                                            double std,
                                            int... shape)

      Parameters:
        `mean` - mean of distribution
        `std` - standard deviation
        `shape` - output shape
      Returns:
        an array of values sampled from a Gaussian distribution with given mean and standard deviation

    - #### randint

          public static IntegerDataset randint(int low,
                                               int high,
                                               int[] shape)

      Parameters:
        `low` - lower inclusive bound
        `high` - upper exclusive bound
        `shape` - output shape
      Returns:
        an array of values sampled from a discrete uniform distribution in range [low, high)

    - #### random_integers

          public static IntegerDataset random_integers(int low,
                                                       int high,
                                                       int[] shape)

      Parameters:
        `low` - lower inclusive bound
        `high` - upper inclusive bound
        `shape` - output shape
      Returns:
        an array of values sampled from a discrete uniform distribution in range [low, high]

    - #### exponential

          public static DoubleDataset exponential(double beta,
                                                  int... shape)

      Parameters:
        `beta` - mean
        `shape` - output shape
      Returns:
        an array of values sampled from an exponential distribution with mean beta

    - #### poisson

          public static IntegerDataset poisson(double lam,
                                               int... shape)

      Parameters:
        `lam` - Poisson parameter
        `shape` - output shape
      Returns:
        an array of values sampled from an exponential distribution with mean lambda

    - #### lazyRand

          public static ILazyDataset lazyRand(int... shape)

      Parameters:
        `shape` - output shape
      Returns:
        a lazy dataset with uniformly distributed random numbers

    - #### lazyRand

          public static ILazyDataset lazyRand(String name,
                                              int... shape)

      Parameters:
        `name` - dataset name
        `shape` - output shape
      Returns:
        a lazy dataset with uniformly distributed random numbers

    - #### lazyRand

          @Deprecated
          public static ILazyDataset lazyRand(int dtype,
                                                          String name,
                                                          int... shape)

      Deprecated. Use `lazyRand(String, Class, int...)`
      Parameters:
        `dtype` - dataset type
        `name` - dataset name
        `shape` - output shape
      Returns:
        a lazy dataset with uniformly distributed random numbers

    - #### lazyRand

          public static ILazyDataset lazyRand(String name,
                                              Class<? extends Dataset> clazz,
                                              int... shape)

      Parameters:
        `name` - dataset name
        `clazz` - dataset sub-interface
        `shape` - output shape
      Returns:
        a lazy dataset with uniformly distributed random numbers
      Since:
        2.3

Copyright © 2014–2022 Eclipse Foundation. All rights reserved.