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

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 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