Class LabeledPoint

java.lang.Object
ml.dmlc.xgboost4j.LabeledPoint
All Implemented Interfaces:
Serializable

public final class LabeledPoint extends Object implements Serializable
Labeled training data point. TODO(hcho3): Migrate Record class when we upgrade to Java 14+, to reduce boilerplate.
See Also:
  • Constructor Details

    • LabeledPoint

      public LabeledPoint(float label, int size, int[] indices, float[] values, float weight, int group, float baseMargin)
      Parameters:
      label - Label of this point.
      size - Feature dimensionality
      indices - Feature indices of this point or `null` if the data is dense.
      values - Feature values of this point.
      weight - Weight of this point.
      group - Group of this point (used for ranking) or -1.
      baseMargin - Initial prediction on this point or `Float.NaN`
    • LabeledPoint

      public LabeledPoint(float label, int size, int[] indices, float[] values)
      Parameters:
      label - Label of this point.
      size - Feature dimensionality
      indices - Feature indices of this point or `null` if the data is dense.
      values - Feature values of this point.
    • LabeledPoint

      public LabeledPoint(float label, int size, int[] indices, float[] values, float weight)
      Parameters:
      label - Label of this point.
      size - Feature dimensionality
      indices - Feature indices of this point or `null` if the data is dense.
      values - Feature values of this point.
      weight - Weight of this point.
    • LabeledPoint

      public LabeledPoint(float label, int size, int[] indices, float[] values, float weight, int group)
      Parameters:
      label - Label of this point.
      size - Feature dimensionality
      indices - Feature indices of this point or `null` if the data is dense.
      values - Feature values of this point.
      weight - Weight of this point.
      group - Group of this point (used for ranking) or -1.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • label

      public float label()
    • size

      public int size()
    • indices

      public int[] indices()
    • values

      public float[] values()
    • weight

      public float weight()
    • group

      public int group()
    • baseMargin

      public float baseMargin()