congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
LabeledPoint
Code IndexAdd Tabnine to your IDE (free)

How to use
LabeledPoint
in
ml.dmlc.xgboost4j

Best Java code snippets using ml.dmlc.xgboost4j.LabeledPoint (Showing top 4 results out of 315)

origin: ml.dmlc/xgboost4j

LabeledPoint labeledPoint = base.next();
batch.add(labeledPoint);
numElem += labeledPoint.values().length;
numRows++;
LabeledPoint labeledPoint = batch.get(i);
rowOffset[i] = offset;
label[i] = labeledPoint.label();
weight[i] = labeledPoint.weight();
if (labeledPoint.indices() != null) {
 System.arraycopy(labeledPoint.indices(), 0, featureIndex, offset,
     labeledPoint.indices().length);
} else {
 for (int j = 0; j < labeledPoint.values().length; j++) {
  featureIndex[offset + j] = j;
System.arraycopy(labeledPoint.values(), 0, featureValue, offset,
    labeledPoint.values().length);
offset += labeledPoint.values().length;
origin: org.apache.hivemall/hivemall-xgboost

/** Transform List<String> inputs into a XGBoost input format */
@Nullable
public static LabeledPoint parseFeatures(final double target,
    @Nonnull final String[] features) {
  final int size = features.length;
  if (size == 0) {
    return null;
  }
  final int[] indices = new int[size];
  final float[] values = new float[size];
  for (int i = 0; i < size; i++) {
    if (features[i] == null) {
      continue;
    }
    final String str = features[i];
    final int pos = str.indexOf(':');
    if (pos >= 1) {
      indices[i] = Integer.parseInt(str.substring(0, pos));
      values[i] = Float.parseFloat(str.substring(pos + 1));
    }
  }
  return new LabeledPoint((float) target, indices, values);
}
origin: io.github.myui/xgboost4j

LabeledPoint labeledPoint = base.next();
batch.add(labeledPoint);
numElem += labeledPoint.values().length;
numRows++;
LabeledPoint labeledPoint = batch.get(i);
rowOffset[i] = offset;
label[i] = labeledPoint.label();
weight[i] = labeledPoint.weight();
if (labeledPoint.indices() != null) {
 System.arraycopy(labeledPoint.indices(), 0, featureIndex, offset,
     labeledPoint.indices().length);
} else {
 for (int j = 0; j < labeledPoint.values().length; j++) {
  featureIndex[offset + j] = j;
System.arraycopy(labeledPoint.values(), 0, featureValue, offset,
    labeledPoint.values().length);
offset += labeledPoint.values().length;
origin: ai.h2o/xgboost4j

LabeledPoint labeledPoint = base.next();
batch.add(labeledPoint);
numElem += labeledPoint.values().length;
numRows++;
LabeledPoint labeledPoint = batch.get(i);
rowOffset[i] = offset;
label[i] = labeledPoint.label();
weight[i] = labeledPoint.weight();
if (labeledPoint.indices() != null) {
 System.arraycopy(labeledPoint.indices(), 0, featureIndex, offset,
     labeledPoint.indices().length);
} else {
 for (int j = 0; j < labeledPoint.values().length; j++) {
  featureIndex[offset + j] = j;
System.arraycopy(labeledPoint.values(), 0, featureValue, offset,
    labeledPoint.values().length);
offset += labeledPoint.values().length;
ml.dmlc.xgboost4jLabeledPoint

Most used methods

  • indices
  • label
  • values
  • weight
  • <init>

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Join (org.hibernate.mapping)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now