DiscoveryAIModel

Represents the metadata associated with a model used in Einstein Discovery.

A model is a sophisticated, custom algorithm that Einstein Discovery generates based on a comprehensive, statistical understanding of past outcomes. Einstein Discovery uses models to predict future outcomes. A model accepts the values of one or more predictor variables as input and produces a predicted outcome as output, along with (optionally) top factors and improvements. In Package Manager, this type is listed as “Discovery Model”.

You can also build models using a third-party modeling tool, and then import them into Salesforce using Model Manager in Analytics Studio.

Write operations for DiscoveryAIModel objects are generally not supported.

Note

Parent Type 

This type extends MetadataWithContent and inherits its fields.

File Suffix and Directory Location 

A DiscoveryAIModel is stored in the discovery folder. DiscoveryAIModels have two files:

  • file with .model suffix contains the model’s actual data
  • file named *ModelName*.model-meta.xml suffix contains the model’s metadata

Here is a sample package.xml file:

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>Maximize_Sales</members>
5        <name>DiscoveryAIModel</name>
6    </types>
7    <version>53.0</version>
8</Package>

Version 

DiscoveryAIModels are available in API version 51.0 and later.

Fields 

algorithmType 

classificationThreshold 

  • Type: double
  • Required: No
  • Description: Threshold value. Applies only to binary classification models. For regression models, this is null.

description 

  • Type: string
  • Required: No
  • Description: Model description.

label 

  • Type: string
  • Required: Yes
  • Description: Model label. If you package a model, this label appears in Package Manager.

modelFields 

modelRuntimeType 

predictedField 

  • Type: string
  • Required: Yes
  • Description: Name of the field that is predicted.

predictionType 

sourceType 

status 

trainingMetrics 

  • Type: string
  • Required: No
  • Description: JSON object that represents metrics about the model when it was trained.

transformations 

DiscoveryAIModelStatus Type 

Represents the status of the model (Enabled or Disabled).

DiscoveryAIModelTransformationType Type 

Represents the type of transformation to apply before making a prediction.

DiscoveryAlgorithmType Type 

Represents the algorithm that Einstein Discovery used to create the model.

DiscoveryModelField Type 

Represents a field (variable) in the model.

Fields 

isDisparateImpact 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the field is disparate impact (true) or not (false).

isSensitive 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the field is sensitive (true) or not (false).

label 

  • Type: string
  • Required: Yes
  • Description: Field label displayed in the UI.

name 

  • Type: string
  • Required: Yes
  • Description: Field name.

type 

values 

  • Type: string[]
  • Required: No
  • Description: A list of field values.

DiscoveryModelFieldType Type 

Represents the data type of a model field.

DiscoveryModelRuntimeType Type 

Represents the model run-type.

DiscoveryModelSourceType Type 

Represents the source tool used to build the model: Discovery or an external tool (the model was uploaded into Salesforce).

DiscoveryModelTransform Type 

Represents a transformation in the model.

Fields 

config 

  • Type: string
  • Required: No
  • Description: The configuration for the transformation.

sourceFieldNames 

  • Type: string[]
  • Required: No
  • Description: A list of the source field names.

targetFieldNames 

  • Type: string[]
  • Required: No
  • Description: A list of the target field names.

type 

Declarative Metadata Sample Definitions 

Here is a sample DiscoveryAIModel:

1<?xml version="1.0" encoding="UTF-8"?>
2<DiscoveryAIModel xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3   <content xsi:nil="true"/>
4   <algorithmType>Glm</algorithmType>
5   <classificationThreshold>0.7383</classificationThreshold>
6   <label>Maximize Tenure</label>
7   <modelFields>
8      <label>Field</label>
9      <name>Field</name>
10      <type>Text</type>
11   </modelFields>
12   <modelFields>
13      <label>PTO</label>
14      <name>PTO</name>
15      <type>Number</type>
16   </modelFields>
17   <modelFields>
18      <label>Level</label>
19      <name>Level</name>
20      <type>Text</type>
21   </modelFields>
22   <modelFields>
23      <label>Salary</label>
24      <name>Salary</name>
25      <type>Number</type>
26   </modelFields>
27   <modelFields>
28      <label>Tenure</label>
29      <name>Tenure</name>
30      <type>Number</type>
31   </modelFields>
32   <modelRuntimeType>Discovery</modelRuntimeType>
33   <predictedField>Tenure</predictedField>
34   <predictionType>Classification</predictionType>
35   <sourceType>Discovery</sourceType>
36   <status>Enabled</status>
37</DiscoveryAIModel>

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.