Class Util

java.lang.Object
org.tribuo.classification.sgd.Util

public class Util extends Object
SGD utilities. Currently stores methods for shuffling examples and their associated labels and weights.
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • shuffleInPlace

      @Deprecated public static void shuffleInPlace(SparseVector[] features, int[] labels, double[] weights, SplittableRandom rng)
      In place shuffle of the features, labels and weights.
      Parameters:
      features - Input features.
      labels - Input labels.
      weights - Input weights.
      rng - SplittableRandom number generator.
    • shuffleInPlace

      public static void shuffleInPlace(SparseVector[] features, int[] labels, double[] weights, int[] indices, SplittableRandom rng)
      In place shuffle of the features, labels, weights and indices.
      Parameters:
      features - Input features.
      labels - Input labels.
      weights - Input weights.
      indices - Input indices.
      rng - SplittableRandom number generator.
    • shuffle

      public static Util.ExampleArray shuffle(SparseVector[] features, int[] labels, double[] weights, SplittableRandom rng)
      Shuffles the features, labels and weights returning a tuple of the shuffled inputs.
      Parameters:
      features - Input features.
      labels - Input labels.
      weights - Input weights.
      rng - SplittableRandom number generator.
      Returns:
      A tuple of shuffled features, labels and weights.
    • shuffleInPlace

      public static void shuffleInPlace(SGDVector[][] features, int[][] labels, double[] weights, SplittableRandom rng)
      In place shuffle used for sequence problems.
      Parameters:
      features - Input features.
      labels - Input labels.
      weights - Input weights.
      rng - SplittableRandom number generator.
    • shuffle

      public static Util.SequenceExampleArray shuffle(SGDVector[][] features, int[][] labels, double[] weights, SplittableRandom rng)
      Shuffles a sequence of features, labels and weights, returning a tuple of the shuffled values.
      Parameters:
      features - Input features.
      labels - Input labels.
      weights - Input weights.
      rng - SplittableRandom number generator.
      Returns:
      A tuple of shuffled features, labels and weights.