---
schema_version: "1"
id: 8dddddfd298a182758c0005db27121745e29397161d2d7f8483457609493eb91
title: MLDataDefinition
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_mldatadefinition.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_mldatadefinition.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 040fbe26c75e781ce5060c65f47e68ab0b74bc26d4334e7d16084d16b1c51cc0
description: Represents a modeling data definition, which specifies the data used to create a model. Such data can include filters, fields to include, fields to exclude, and so on. This type extends the Metadata metadata type and inherits its fullName field.
---
# MLDataDefinition

Represents a modeling data definition, which specifies the data used to create a model. Such data can include filters, fields to include, fields to exclude, and so on. This type extends the Metadata metadata type and inherits its fullName field.

## File Suffix and Directory Location

MLDataDefinition components have the suffix .mlDataDefinition and are stored in the mlDataDefinitions folder.

## Version

MLDataDefinition is available in API version 50.0 and later.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d667707e83">Field Name</th>

              <th class="featureTableHeader  " id="d667707e86">Field Type</th>

              <th class="featureTableHeader  " id="d667707e89">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">developerName</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e89" data-title="Description">Required. Represents the name of the data definition. Can contain only underscores and
                alphanumeric characters and must be unique in your org. It must begin with a letter,
                not include spaces, not end with an underscore, and not contain two consecutive
                underscores. Only users with View DeveloperName OR View Setup and Configuration
                permission can view, group, sort, and filter this field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">entityDeveloperName</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e89" data-title="Description">Required. The developer name of the object from which the model data is retrieved.
                After the MLDataDefinition entity is created,
                <span class="keyword parmname">entityDeveloperName</span> can’t be updated.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">excludedFields</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">string[]</td>

              <td class="entry" headers="d667707e89" data-title="Description">Fields that are excluded from the model.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">includedFields</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">string[]</td>

              <td class="entry" headers="d667707e89" data-title="Description">Fields that are included in the model.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">joinFields</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">
                <a class="xref" href="#MLFieldVariable">MLField</a>[]
              </td>

              <td class="entry" headers="d667707e89" data-title="Description">Reserved for future use.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">parentDefinitionDevName</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e89" data-title="Description">Reserved for future use.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">scoringFilter</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type"><a class="xref" href="#MLFilterVariable">MLFilter</a></td>

              <td class="entry" headers="d667707e89" data-title="Description">Specifies records to which the prediction scores are written.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">segmentFilter</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type"><a class="xref" href="#MLFilterVariable">MLFilter</a></td>

              <td class="entry" headers="d667707e89" data-title="Description">This field further filters data used in training and scoring when
                <span class="keyword parmname">segmentFilter</span> is combined with both
                <span class="keyword parmname">scoringFilter</span> and <span class="keyword parmname">trainingFilter</span>. For
                example, select all records in a specific region.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">trainingFilter</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type"><a class="xref" href="#MLFilterVariable">MLFilter</a></td>

              <td class="entry" headers="d667707e89" data-title="Description">Specifies the records that make up the training set.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e83" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d667707e86" data-title="Field Type">MLDataDefinitionType (enumeration of type string)</td>

              <td class="entry" headers="d667707e89" data-title="Description">Required. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Candidate</samp></li>

                  <li class="li"><samp class="codeph nolang">Interaction</samp></li>

                  <li class="li"><samp class="codeph nolang">Prediction</samp></li>

                  <li class="li"><samp class="codeph nolang">Recipient</samp></li>

                </ul>
                <p class="p">After the model is created, <span class="keyword parmname">type</span> can’t be
                  updated.</p>
              </td>

            </tr>

          </tbody>

        </table>

## MLField

Represents a single field in the data definition. Available in API version 50.0 and later.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d667707e298">Field Name</th>

              <th class="featureTableHeader  " id="d667707e301">Field Type</th>

              <th class="featureTableHeader  " id="d667707e304">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d667707e298" data-title="Field Name"><span class="keyword parmname">entity</span></td>

              <td class="entry" headers="d667707e301" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e304" data-title="Description">Required. The object that contains the field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e298" data-title="Field Name"><span class="keyword parmname">field</span></td>

              <td class="entry" headers="d667707e301" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e304" data-title="Description">Required. The name of the field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e298" data-title="Field Name"><span class="keyword parmname">relatedField</span></td>

              <td class="entry" headers="d667707e301" data-title="Field Type">MLField</td>

              <td class="entry" headers="d667707e304" data-title="Description">Reserved for future use.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e298" data-title="Field Name"><span class="keyword parmname">relationType</span></td>

              <td class="entry" headers="d667707e301" data-title="Field Type">MLRelationType (enumeration of type string)</td>

              <td class="entry" headers="d667707e304" data-title="Description">Reserved for future use. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Full</samp></li>

                  <li class="li"><samp class="codeph nolang">Inner</samp></li>

                  <li class="li"><samp class="codeph nolang">Leftinner</samp></li>

                  <li class="li"><samp class="codeph nolang">Leftouter</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e298" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d667707e301" data-title="Field Type">MLFieldType (enumeration of type string)</td>

              <td class="entry" headers="d667707e304" data-title="Description">Required. How the field is used in a prediction. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Excluded</samp></li>

                  <li class="li"><samp class="codeph nolang">Expression</samp></li>

                  <li class="li"><samp class="codeph nolang">Included</samp></li>

                  <li class="li"><samp class="codeph nolang">Join</samp></li>

                  <li class="li"><samp class="codeph nolang">Prediction</samp></li>

                  <li class="li"><samp class="codeph nolang">Pushback</samp></li>

                  <li class="li"><samp class="codeph nolang">Related</samp></li>

                  <li class="li"><samp class="codeph nolang">SourceDate</samp></li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## MLFilter

Represents a data filter based on a data comparison. For each comparison, there’s a left-hand element, an operator, and a right-hand element. For each record, only one of these left-hand elements is populated: lhFilter, lhPredictionField, or lhValue. Similarly, for each record, only one of these right-hand elements is populated: rhFilter, rhPredictionField, or rhValue. Available in API version 50.0 and later.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d667707e475">Field Name</th>

              <th class="featureTableHeader  " id="d667707e478">Field Type</th>

              <th class="featureTableHeader  " id="d667707e481">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">filterName</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e481" data-title="Description">Required. Name of the filter.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">lhFilter</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">MLFilter</td>

              <td class="entry" headers="d667707e481" data-title="Description">Left-hand filter condition.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">lhPredictionField</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e481" data-title="Description">Left-hand prediction field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">lhType</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">AIValueType (enumeration of type string)</td>

              <td class="entry" headers="d667707e481" data-title="Description">The value type if a left-hand value is specified. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Boolean</samp></li>

                  <li class="li"><samp class="codeph nolang">Comparison</samp></li>

                  <li class="li"><samp class="codeph nolang">Currency</samp></li>

                  <li class="li"><samp class="codeph nolang">Date</samp></li>

                  <li class="li"><samp class="codeph nolang">DateTime</samp></li>

                  <li class="li"><samp class="codeph nolang">Number</samp></li>

                  <li class="li"><samp class="codeph nolang">String</samp></li>

                  <li class="li"><samp class="codeph nolang">Supplier</samp></li>

                  <li class="li"><samp class="codeph nolang">Varchar</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">lhUnit</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">AIFilterUnit (enumeration of type string)</td>

              <td class="entry" headers="d667707e481" data-title="Description">The unit if a left-hand filter is specified. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Milliseconds</samp></li>

                  <li class="li"><samp class="codeph nolang">Seconds</samp></li>

                  <li class="li"><samp class="codeph nolang">Minutes</samp></li>

                  <li class="li"><samp class="codeph nolang">Hours</samp></li>

                  <li class="li"><samp class="codeph nolang">Days</samp></li>

                  <li class="li"><samp class="codeph nolang">Weeks</samp></li>

                  <li class="li"><samp class="codeph nolang">Months</samp></li>

                  <li class="li"><samp class="codeph nolang">Years</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">lhValue</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e481" data-title="Description">The left-hand value.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">operation</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">AIFilterOperation (enumeration of type string)</td>

              <td class="entry" headers="d667707e481" data-title="Description">Required. Valid values are: <ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">And</samp></li>

                  <li class="li"><samp class="codeph nolang">Or</samp></li>

                  <li class="li"><samp class="codeph nolang">Not</samp></li>

                  <li class="li"><samp class="codeph nolang">LessThan</samp></li>

                  <li class="li"><samp class="codeph nolang">LessThanOrEqual</samp></li>

                  <li class="li"><samp class="codeph nolang">GreaterThan</samp></li>

                  <li class="li"><samp class="codeph nolang">GreaterThanOrEqual</samp></li>

                  <li class="li"><samp class="codeph nolang">Equals</samp></li>

                  <li class="li"><samp class="codeph nolang">NotEquals</samp></li>

                  <li class="li"><samp class="codeph nolang">Add</samp></li>

                  <li class="li"><samp class="codeph nolang">Subtract</samp></li>

                  <li class="li"><samp class="codeph nolang">Multiply</samp></li>

                  <li class="li"><samp class="codeph nolang">Divide</samp></li>

                  <li class="li"><samp class="codeph nolang">IsNull</samp></li>

                  <li class="li"><samp class="codeph nolang">IsNotNull</samp></li>

                  <li class="li"><samp class="codeph nolang">StartsWith</samp></li>

                  <li class="li"><samp class="codeph nolang">EndsWith</samp></li>

                  <li class="li"><samp class="codeph nolang">Contains</samp></li>

                  <li class="li"><samp class="codeph nolang">Concat</samp></li>

                  <li class="li"><samp class="codeph nolang">DoesNotContain</samp></li>

                  <li class="li"><samp class="codeph nolang">Between</samp></li>

                  <li class="li"><samp class="codeph nolang">In</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">rhFilter</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">MLFilter</td>

              <td class="entry" headers="d667707e481" data-title="Description">Right-hand filter condition.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">rhPredictionField</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e481" data-title="Description">Right-hand prediction field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">rhType</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">AIValueType (enumeration of type string)</td>

              <td class="entry" headers="d667707e481" data-title="Description">The value type if a right-hand value is specified. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Boolean</samp></li>

                  <li class="li"><samp class="codeph nolang">Comparison</samp></li>

                  <li class="li"><samp class="codeph nolang">Currency</samp></li>

                  <li class="li"><samp class="codeph nolang">Date</samp></li>

                  <li class="li"><samp class="codeph nolang">DateTime</samp></li>

                  <li class="li"><samp class="codeph nolang">Number</samp></li>

                  <li class="li"><samp class="codeph nolang">String</samp></li>

                  <li class="li"><samp class="codeph nolang">Supplier</samp></li>

                  <li class="li"><samp class="codeph nolang">Varchar</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">rhUnit</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">AIFilterUnit (enumeration of type string)</td>

              <td class="entry" headers="d667707e481" data-title="Description">The unit if a right-hand filter is specified. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">Milliseconds</samp></li>

                  <li class="li"><samp class="codeph nolang">Seconds</samp></li>

                  <li class="li"><samp class="codeph nolang">Minutes</samp></li>

                  <li class="li"><samp class="codeph nolang">Hours</samp></li>

                  <li class="li"><samp class="codeph nolang">Days</samp></li>

                  <li class="li"><samp class="codeph nolang">Weeks</samp></li>

                  <li class="li"><samp class="codeph nolang">Months</samp></li>

                  <li class="li"><samp class="codeph nolang">Years</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">rhValue</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">string</td>

              <td class="entry" headers="d667707e481" data-title="Description">The right-hand value.</td>

            </tr>

            <tr>
              <td class="entry" headers="d667707e475" data-title="Field Name"><span class="keyword parmname">sortOrder</span></td>

              <td class="entry" headers="d667707e478" data-title="Field Type">int</td>

              <td class="entry" headers="d667707e481" data-title="Description">Specifies the order of operations for evaluating the expressions. For example, if you
                have two conditions, this field specifies which condition is evaluated
                first.</td>

            </tr>

          </tbody>

        </table>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).