Package org.tribuo.classification.sgd
Class Util
java.lang.Object
org.tribuo.classification.sgd.Util
SGD utilities. Currently stores methods for shuffling examples and their associated labels and weights.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A nominal tuple.static class
A nominal tuple. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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.static void
shuffleInPlace
(SGDVector[][] features, int[][] labels, double[] weights, SplittableRandom rng) In place shuffle used for sequence problems.static void
shuffleInPlace
(SparseVector[] features, int[] labels, double[] weights, int[] indices, SplittableRandom rng) In place shuffle of the features, labels, weights and indices.static void
shuffleInPlace
(SparseVector[] features, int[] labels, double[] weights, SplittableRandom rng) Deprecated.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
shuffleInPlace
@Deprecated public static void shuffleInPlace(SparseVector[] features, int[] labels, double[] weights, SplittableRandom rng) Deprecated.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.
-
AbstractSGDTrainer.shuffleInPlace(org.tribuo.math.la.SGDVector[], T[], double[], java.util.SplittableRandom)
.