Package ml.dmlc.xgboost4j
Class LabeledPoint
java.lang.Object
ml.dmlc.xgboost4j.LabeledPoint
- All Implemented Interfaces:
Serializable
Labeled training data point.
TODO(hcho3): Migrate Record class when we upgrade to Java 14+, to reduce boilerplate.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLabeledPoint(float label, int size, int[] indices, float[] values) LabeledPoint(float label, int size, int[] indices, float[] values, float weight) LabeledPoint(float label, int size, int[] indices, float[] values, float weight, int group) LabeledPoint(float label, int size, int[] indices, float[] values, float weight, int group, float baseMargin) -
Method Summary
-
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 dimensionalityindices- 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 dimensionalityindices- 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 dimensionalityindices- 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 dimensionalityindices- 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() -
equals
-
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()
-