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

    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)`
    `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` -

    - #### seed

          public static void seed(int[] seed)

      Parameters:
        `seed` -

    - #### seed

          public static void seed(long seed)

      Parameters:
        `seed` -

    - #### rand

          public static DoubleDataset rand(int... shape)

      Parameters:
        `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` -
        `high` -
        `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` -
      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` -
        `std` - standard deviation
        `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` -
        `high` -
        `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` -
        `high` -
        `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` -
        `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` -
        `shape` -
      Returns:
        an array of values sampled from an exponential distribution with mean lambda

    - #### lazyRand

          public static ILazyDataset lazyRand(int... shape)

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

    - #### lazyRand

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

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

    - #### lazyRand

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

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

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