DataRobot-Research/drdocs huggingface dataset:
---
title: Predictions from documents
description: Multiple methods are available for making predictions with Document AI.
section_name: AutoML
maturity: public-preview
---

# Predictions from documents {: #predictions-from-documents }


The following prediction methods are available for Document AI.

Method | Description
------ | -----------
[UI](predict) | Upload an archive or dataset file for predictions from the UI.

For all other types other than deployment batch predictions, you must include PDF documents as base64-encoded strings. The public API client includes a utility function to help with conversion.

Method | Description
------ | -----------
[API](realtime/index)  | Use scripting code and base64-converted document files to make an API call and get predictions from the deployed model. The output will be a CSV file with prediction results.
[Portable Prediction Server](port-pred/index) | Use base64-converted document files for either single-model or multi-model modes.
[Portable Batch Predictions](batch/index) | Use base64-converted document files for all supported adapters (filesystem, JDBC, AWS S3, Azure Blob, GCS, Snowflake, Synapse).
---
title: Predict
description: Details on the Leaderboard Predict tab's capabilities.

---


# Predict {: #predict }

The **Predict** tab allows you to download various model assets and test predictions. For more information about the predictions methods in DataRobot, see [Predictions Overview](../../../predictions/index).

The following sections describe the components of the **Predict** tab.

Tab | Description
------ | ------------
[Make Predictions](predict) | Use the model to test predictions on up to 1GB of data before deploying it.
[Deploy](deploy)  | Deploy a model from the Leaderboard to make predictions in a production environment.
[Downloads](download) | Download artifacts, such as model packages and a ZIP archive of model information.
[Portable Predictions](port-pred) | Execute predictions outside of the DataRobot application using [Scoring Code](port-pred/scoring-code/index) or the [Portable Prediction Server](port-pred/pps/index). |
---
title: Work with large datasets
description: This section provides information on working with large datasets. Consider Fast EDA for large sets up to 10GB; use scalable ingest for sets up to 100GB.

---

# Large datasets {: #large-datasets }

The following sections provide additional information on working with large datasets. Consider Fast EDA for large sets up to 10GB; use scalable ingest for sets up to 100GB.

Topic | Describes...
----- | ------
[Fast EDA for large datasets](fast-eda) | Details of the Fast EDA process.
---
title: Import data from AWS S3
description: Import data from AWS S3 to start a DataRobot ML project.

---


# Import data from AWS S3 {: #import-data-from-aws-s3 }

This section shows how to ingest data from an Amazon Web Services S3 bucket into the DataRobot AI Catalog so that you can use it for ML modeling. 

To build an ML model based on an object saved in an S3 bucket:

1. Navigate to the dataset object in AWS S3 and copy the object’s URL.

    ![](images/int_ifas_large_004.png)

2. Select the **AI Catalog** tab in DataRobot.

    ![](images/int_ifas_large_003.png)


3. Click **Add to catalog** and select **URL**.

    ![](images/int_ifas_large_002.png)

4. In the **Add from URL** window, paste the URL of the object and click **Save**. 

    ![](images/int_ifas_add_to_catalog_url.png)

    DataRobot automatically reads the data and infers data types and the schema of the data, as it does when you upload a CSV file from your local machine.

5. Now that your data has been successfully uploaded, click **Create project** in the upper right corner to start an ML project.

    ![](images/int_ifas_large.png)

## Private S3 buckets {: #private-s3-buckets }

You can also ingest data into DataRobot from private S3 buckets. For example, you can create a temporary link from a pre-signed S3 URL that DataRobot can then use to retrieve the file.

A straightforward way to accomplish this is by using the [AWS Command Line Interface (CLI)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html){ target=_blank }.

After you install and configure the CLI, use a command like the following:

```
aws s3 presign --expires-in 600 s3://bucket-name/path/to/file.csv
https://bucket-name.s3.amazonaws.com/path/to/file.csv?AWSAccessKeyId=<key>
```

The URL produced in this example allows whoever has it to read the private file, `file.csv`, from the private bucket, `bucket-name`. The `expires-in` parameter makes the signed link available for 600 seconds upon creation.


If you have your own DataRobot installation, you can also:

* Provide the application's DataRobot service account with IAM privileges to read private S3 buckets. DataRobot can then ingest from any S3 location that it has privileges to access.
* Implement S3 impersonation of the user logging in to DataRobot to limit access to S3 data. This requires LDAP for authentication, with authorized roles for the user specified within LDAP attributes.

Both of these options accept an `s3://` URI path.
You can snapshot iterations of a notebook, allowing you to maintain older versions that you can revert back to in the future. These snapshots are called revisions (also known as checkpoints). Each saved revision contains the notebook's cells and their output in their state at the time of the snapshot.

### Revision types {: #revision-types }

DataRobot Notebooks support both automatic and manual revisions.

*Automatic revisions* are saved each time a notebook’s active session is shut down (from either your own termination of the session or via an inactivity timeout). Automatic revisions are defined by the creation timestamp and include an "Autosaved" label.

![](images/nb-29.png)

You can create a *manual revision* at any time to save a checkpoint of a notebook. To do so, navigate to the **Revision history** tab in the sidebar.

{% if section(page, "dr-notebooks") %}

![](images/nb-19.png)

{% else %}

![](images/wb-nb-19.png)

{% endif %}

Click **Create new revision**. Provide a name for the revision in the a dialog box. If no name is specified, the timestamp of the checkpoint creation is used. Once named, click **Create**.

{% if section(page, "dr-notebooks") %}

![](images/nb-20.png)

{% else %}

![](images/wb-nb-20.png)

{% endif %}

### Revision history {: #revision-history }

View a list of all revisions (manual and automatic) for a notebook from the **Revision history** in the left panel. Click on the revision entry to view a preview of that version of the notebook:

{% if section(page, "dr-notebooks") %}

![](images/nb-21.png)

{% else %}

![](images/wb-nb-21.png)

{% endif %}

You can restore your current notebook to a specific revision by clicking **Restore this revision** at the bottom of the preview.

Access additional actions for managing revisions by clicking the menu icon on the right of each entry. Note that you can update the names of manual revisions, while autosaved revisions will only have their timestamp as a name.

![](images/nb-22.png)

This menu gives you options to:

* Restore revision: Restore the current notebook to the state of the selected revision. After restoring to a given revision, saving will create new revisions at the top of the revision list.
* Clone revision: Create a copy of the revision as a new notebook.
* Delete the revision: Permanently delete an entry from the notebook’s revision history.
## Build time-aware models {: #build-time-aware-models }

Once you click **Start**, DataRobot begins the model-building process and returns results to the Leaderboard. Because time series modeling uses date/time partitioning, you can run backtests, change window sampling, change training periods, and more from the Leaderboard.

!!! note
    Model parameter selection has not been customized for date/time-partitioned projects. Though automatic parameter selection yields good results in most cases, [**Advanced Tuning** ](adv-tuning) may significantly improve performance for some projects that use the Date/Time partitioning feature.


### Date duration features {: #date-duration-features }

Because having raw dates in modeling can be risky (overfitting, for example, or tree-based models that do not extrapolate well), DataRobot generally excludes them from the Informative Features list if date transformation features were derived. Instead, for OTV projects, DataRobot creates duration features calculated from the difference between date features and the primary date. It then adds the duration features to an optimized Informative Features list. The automation process creates:

* New duration features
* New feature lists

#### New duration features {: #new-duration-features }

When derived features (hour of day, day of week, etc.) are created, the feature type of the newly derived features are not dates. Instead, they become categorical or numeric, for example. To ensure that models learn time distances better, DataRobot computes the duration between primary and non-primary dates, adds that calculation as a feature, and then drops all non-primary dates.

Specifically, when date derivations happen in an OTV project, DataRobot creates one or more new features calculated from the duration between dates. The new features are named `duration(<from date>, <to date>)`, where the `<from date>` is the primary date. The var type, displayed on the **Data** page, displays `Date Duration`.

![](images/date-duration-dp.png)


The transformation applies even if the time units differ. In that case, DataRobot computes durations in seconds and displays the information on the **Data** page (potentially as huge integers). In some cases, the value is negative because the `<to date>` may be before the primary date.


#### New feature lists {: #new-feature-lists }

The new feature lists, automatically created based on Informative Features and Raw Features, are a copy of the originals with the duration feature(s) added. They are named the same, but with "optimized for time-aware modeling" appended. (For univariate feature lists, `duration` features are only added if the original date feature was part of the original univariate list.)

![](images/date-duration-fls.png)

When you run full or Quick Autopilot, new feature lists are created later in the [EDA2](eda-explained#eda2) process. DataRobot then switches the Autopilot process to use the new, optimized list. To use one of the non-optimized lists, you must rerun Autopilot specifying the list you want.
---
title: Demand forecasting
description: Learn about an end-to-end demand forecasting use case that uses DataRobot's Python package.

---

# Large-scale demand forecasting {: #large-scale-demand-forecasting }

The notebooks listed below outline how to performed large-scale demand forecasting using DataRobot's Python package. No single model can handle extreme data diversity or forecast the complexity of human buying patterns at a detailed level. Complex demand forecasting typically requires deep statistical know-how and lengthy development projects around big data architectures. This notebook builds a model factory to automate this requirement by creating multiple projects "under the hood."

Follow the notebooks below in order to complete the demand forecasting workflow.

| Topic | Describes...  |
| ------------| ----------------------------- |
| [Setup and upload data](demand-setup.ipynb)  | Install and import the required libraries, connect to DataRobot, and curate the data for modeling. |
| [Cluster data](cluster-data.ipynb) | Break a dataset up into smaller datasets that group similar items together. |
| [Build models](demand-factory.ipynb) | Use segmented modeling to improve model performance and decrease time to deployment. |
| [Get model insights and create feature lists](demand-insights.ipynb)  | Review insights for the top-performing model and create new feature lists. |
| [Deploy a model and make predictions](demand-pred.ipynb) | Test a model's prediction capabilities and deploy a model to a production environment to generate predictions. |
---
title: Learn more
description: Get started in DataRobot with descriptions of common terms and concepts, as well as how-tos.
---

# Learn more {: #learn-more }

This page provides access to learning resources that help you get started in DataRobot, including simplified explanations of concepts, how-tos and end-to-end walkthroughs, and descriptions of terms in the application.

Topic       | Describes...
---------- | -----------
[Glossary](glossary/index) | Read descriptions for terms used throughout DataRobot.
[How-tos](how-to/index) | Step-by-step instructions to perform tasks within the DataRobot application as well as partners, cloud providers, and 3rd party vendors.
[ELI5](eli5)    | Read simplified descriptions of common DataRobot concepts.
[Robot-to-Robot](robot-to-robot/index) | See the data science topics that DataRobot employees talk about in Slack.
[Business accelerators](biz-accelerators/index) | End-to-end walkthroughs, based on best practices and patterns, that address common business problems.
---
title: Tackle churn before modeling
description: Discover the problem framing and data management steps required to successfully model for churn, using a B2C retail example and a B2B example based on a DataRobot’s churn model.

---

# Tackle churn before modeling {: #tackle-churn-before-modeling }

[Access this AI accelerator on GitHub <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](https://github.com/datarobot-community/ai-accelerators/tree/main/game-changer/churn_blog){ target=_blank }

Customer retention is central to any successful business and machine learning is frequently proposed as a way of addressing churn. It is tempting to dive right into a churn dataset, but improving outcomes requires correctly framing the problem. Doing so at the start will determine whether the business can take action based on the trained model and whether your hard work is valuable or not.

This accelerator blog will teach the problem framing and data management steps required before modeling begins. It uses two examples to illustrate concepts: a B2C retail example, and a B2B example based on DataRobot’s internal churn model.
---
title: Date/time partitioning advanced options
description: Date/time partitioning sets up the underlying structure that supports time-aware modeling.
---

# Date/time partitioning advanced options {: #configure-ts-date-time-partitioning-advanced-options }

DataRobot's default partitioning settings are optimized for the specific dataset and target feature selected. For most users, the defaults that DataRobot selects provide optimized modeling. See the time series [customization documentation](ts-customization) to gain an  understanding of how DataRobot calculates partitions and advice on setting window sizes.

If you do choose to change partitioning, the content below describes changing backtest partitions.

## Advanced options {: #advanced-options }

Expand the **Show Advanced options** link to set details of the partitioning method. When you enable time-aware modeling, **Advanced options** opens to the date/time partitioning method by default. The **Backtesting** section of date/time partitioning provides tools for configuring backtests for your time-aware projects.

![](images/time-show-adv.png)

{% include 'includes/date-time-include-1.md' %}

{% include 'includes/date-time-include-6.md' %}
---
title: Prepare learning data
description: The tutorials in this section provide quick, task-based instructions that will help you with common data preparation tasks.

---

# Prepare learning data {: #prepare-learning-data }

The content in this section provides quick FAQ answers as well as task-based tutorials for achieving common data preparation and management tasks.

Topic | Describes how to...
----- | ------
[Import data to DataRobot](import-data-dr-tutorial) | Learn guidelines for importing data, and walk through import methods using the DataRobot interface.
[Manage data with the AI Catalog](ai-catalog-tutorial) | Learn how to add data to the AI Catalog, including using Spark SQL to blend data from multiple data sources.
[Assess data quality during EDA](assess-data-quality-eda) | Assess the quality of your data during each phase of Exploratory Data Analysis (EDA). |
[Work with feature lists](work-with-feature-lists) | View the feature lists DataRobot builds and create your own custom feature lists. |
[Analyze features using histograms](analyze-features-using-histograms) | Analyze the distribution of a feature's values and investigate outliers. |
[Analyze frequent values](analyze-frequent-values) | Look into the values that appear most and least frequently for a feature. |
[Analyze feature associations](analyze-feature-associations) | Use a Feature Association matrix to visualize feature relationships and clusters. |
[Enrich data using Feature Discovery](enrich-data-using-feature-discovery) |  Join datasets to allow DataRobot to discover and engineer new features.
---
title: Scoring Code overview
description: How to use the Scoring Code feature for qualifying Leaderboard models, allowing you to use DataRobot-generated models outside of the DataRobot platform.

---

# Scoring Code overview {: #scoring-code-overview }

!!! info "Availability information"
     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](leaderboard-ref#tags-and-indicators) on the Leaderboard.

You can export a model's Scoring Code from the [Leaderboard](sc-download-leaderboard) or [the model's deployment](sc-download-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&mdash;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.

??? tip "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**](log) tab for error details.

## Why use Scoring Code? {: #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](sc-download-leaderboard) or [a deployment](sc-download-deployment)
* [Scoring at the command line](scoring-cli)
* [JAR file structure](jar-package)
* [Scoring Code JAR integrations](sc-jar-integrations)

!!! note
    The model JAR files require Java 8 or later.

{% include 'includes/scoring-code-consider.md' %}
---
title: Cross-Class Accuracy
description: How to use the Cross-Class Accuracy table to understand the model's accuracy performance for each protected class.

---

# Cross-Class Accuracy {: #cross-class-accuracy }

The **Cross-Class Accuracy** tab calculates, for each protected feature, evaluation metrics and ROC curve-related scores segmented by class. Use these metrics to better understand how well the model is performing, and its behavior on a given protected feature/class segment.

![](images/bias-fairness-9.png)

##  Cross-Class Accuracy table {: #cross-class-accuracy-table }

Use the **Cross-Class Accuracy** table to understand the model's accuracy performance for each protected class. Change the protected feature using the dropdown at the top.

The table below describes each accuracy metric:

|    Metric   |   Description    |
|-------------|------------------|
| [Optimization metric](opt-metric) (LogLoss in this example) | Displays the optimization metric selected on the **Data** page before model building.  |
| [F1](metrics)   | Reports the model's accuracy score, computed based on precision and recall.  |
| [AUC (Area under the curve)](roc-curve#area-under-the-roc-curve) | Measures how well the model can distinguish between classes. |
| [Accuracy](metrics)  | Measures the percentage of correctly classified instances.  |


The above example compares LogLoss (the project's optimization metric) between male and female. The score for females is lower, meaning the model is better at predicting salary rate correctly for females than males.
---
title: Use feature engineering and Visual AI with acoustic data
description: Generate image features in addition to aggregate numeric features for high frequency data sources.

---

# Use feature engineering and Visual AI with acoustic data {: #use-feature-engineering-and-visual-ai-with-acoustic-data }

[Access this AI accelerator on GitHub <span style="vertical-align: sub">:material-arrow-right-circle:{.lg }</span>](https://github.com/datarobot-community/ai-accelerators/blob/main/game-changer/high_freq_data_to_images/high_frequency_data_classification_using_spectrograms_n_numerics/high_frequency_classification_spectrograms_n_numerics.ipynb){ .md-button }

The density of high frequency data presents a challenge for standard machine learning workflows that lack specialized feature engineering techniques to condense the signal, extracting and highlighting its uniqueness. DataRobot's multimodal input capability supports simultaneously leveraging numerics and images, which for this use-case is particularly beneficial for including descriptive spectrograms that enable you to leverage well-established computer vision techniques for complex data understanding.

This example notebook shows how to generate image features and aggregate numeric features for high frequency data sources. This approach converts audio wav files from the time domain into the frequency domain to create several types of spectrograms. Statistical numeric features computed from the converted signal add additional descriptors to aid classification of the audio source.