Skip to content

Click in-app to access the full platform documentation for your version of DataRobot.


Availability information

Contact your DataRobot representative for information on enabling the Scoring Code feature.

Models displaying the SCORING CODE icon on the Leaderboard are available for scoring code download. Navigate to the Predict > Downloads tab, where you can select a download option and access a link to the up-to-date model API documentation.


The model JAR files require Java 8 or later.

See below for:

Command line interface

Following is complete syntax for using the binary scoring code JAR to score a .csv file:

 $ java -jar .jar csv --input= --output= [--help] [--encoding=] [--delimiter=]
 [--passthrough_columns=] [--chunk_size=] [--workers_number=] [--log_level=]
 [--fail_fast] [--pred_name=] [--timeout=] [--buffer_size=] [--model_id=]

For example:

$ java -jar 5cd071deef881f011a334c2f.jar csv --input=Iris.csv --output=Isis_out.csv


$ head Iris_out.csv

See also descriptions of command line parameters and increasing Java heap memory.

Java API Example

To be used with the Java API, add the downloaded .jar file to the classpath of the java project. This API has different output formats for regression and classification projects. Below is an example of both:

import com.datarobot.prediction.IClassificationPredictor;
import com.datarobot.prediction.IRegressionPredictor;
import com.datarobot.prediction.Predictors;

import java.util.HashMap;
import java.util.Map;

public class Main {

   public static void main(String[] args) {
      // data is being passed as a Java map
      Map<String, Object> row = new HashMap<>();
      row.put("a", 1);
      row.put("b", "some string feature");
      row.put("c", 999);

      // below is an example of prediction of a single variable (regression)

      // model id is the name of the .jar file
      String regression_modelId = "5d2db3e5bad451002ac53318";

      // get a regression predictor object given model
      IRegressionPredictor regression_predictor =

      double scored_value = regression_predictor.score(row);

      System.out.println("The predicted variable: " + scored_value);

      // below is an example of prediction of class probabilities (classification)

      // model id is the name of the .jar file
      String classification_modelId = "5d36ee03962d7429f0a6be72";

      // get a classification predictor object given model
      IClassificationPredictor predictor =

      Map<String, Double> class_probabilities = predictor.score(row);

      for (String class_label : class_probabilities.keySet()) {
         System.out.println(String.format("The probability of the row belonging to class %s is %f",
            class_label, class_probabilities.get(class_label)));

See also a backward-compatibility example for use when models are generated by different versions of DataRobot.

Updated October 27, 2021
Back to top