Scoring Code overview¶
Contact your DataRobot representative for information on enabling the Scoring Code feature.
Scoring Code allows you to export DataRobot-generated models as JAR files that you can use outside of the platform. DataRobot automatically runs code generation for qualifying models and indicates code availability with a SCORING CODE indicator on the Leaderboard.
You can export a model's Scoring Code from the Leaderboard or the model's deployment. The download includes a pre-compiled JAR file (with all dependencies included), as well as the source code JAR file. Once exported, you can view the model's source code to help understand each step DataRobot takes in producing your predictions.
Scoring Code JARs contain Java Scoring Code for a predictive model. The prediction calculation logic is identical to the DataRobot API—the code generation mechanism tests each model for accuracy as part of the generation process. The generated code is easily deployable in any environment and is not dependent on the DataRobot application.
How does DataRobot determine which models will have Scoring Code?
When the Scoring Code feature is enabled, DataRobot generates a Java alternative for each blueprint preprocessing step and compares its results on the validation set with the original results. If the difference between results is greater than 0.00001, DataRobot does not provide the option to download the Scoring Code. In this way, DataRobot ensures that the Scoring Code JAR model always produces the same predictions as the original model. If verification fails, check the Log tab for error details.
Why use Scoring Code?¶
Flexibility: Can be used anywhere that Java code can be executed.
Speed: Provides low-latency scoring without the API call overhead. Java code is typically faster than scoring through the Python API.
Integrations: Lets you integrate models into systems that can’t necessarily communicate with the DataRobot API. The Scoring Code can be used either as a primary means of scoring for fully offline systems or as a backend for systems that are using the DataRobot API.
Precision: Provides a complete match of predictions generated by DataRobot and the JAR model.
Hardware: Allows you to use additional hardware to score large amounts of data.
See the following sections for more details:
- Downloading Scoring Code from the Leaderboard or a deployment
- Scoring at the command line
- JAR file structure
- Scoring Code JAR integrations
The model JAR files require Java 8 or later.
Scoring Code or DataRobot Prime?¶
Both DataRobot Prime and the Scoring code JAR option provide code that is easily deployable for making offline predictions, independent of the DataRobot application. When deciding which approach best suits your needs, consider the following:
|Java scoring code||DataRobot Prime or Scoring Code|
|Python scoring code||DataRobot Prime, Rulefit Models|
|C++ scoring code||Scoring Code|
|Tunable accuracy/speed trade-off||DataRobot Prime|
For full details, see the reasons to use DataRobot Prime.
Consider the following when working with Scoring Code:
Using Scoring Code in production requires additional development efforts to implement model management and model monitoring, which the DataRobot API provides out of the box.
Exportable Java Scoring Code requires extra RAM during model building. As a result, to use this feature, you should keep your training dataset under 8GB. Projects larger than 8GB may fail due to memory issues. If you get an out-of-memory error, decrease the sample size and try again. The memory requirement does not apply during model scoring. During scoring, the only limitation on the dataset is the RAM of the machine on which the Scoring Code is run.
Scoring code is not supported in time series binary classification projects.
Keras models do not support Scoring Code by default; however, support can be enabled by having an administrator activate the Enable Scoring Code Support for Keras Models feature flag. If enabled, note that these models are not compatible with Scoring Code for Android and Snowflake.
Additional instances in which Scoring Code generation is not available include:
- Naive Bayes
- Text tokenization involving the MeCab tokenizer
- Visual AI and Location AI
Prediction Explanations support¶
Consider the following when working with Prediction Explanations for Scoring Code:
To download Prediction Explanations with Scoring Code, you must select Include Prediction Explanations during Leaderboard download or Deployment download. This option is not available for Legacy download.
Scoring Code doesn't support Prediction Explanations for time series models.