/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the sagemaker-2017-07-24.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.SageMaker.Model { /// /// The inference configuration parameter for the model container. /// public partial class ClarifyInferenceConfig { private string _contentTemplate; private List _featureHeaders = new List(); private string _featuresAttribute; private List _featureTypes = new List(); private string _labelAttribute; private List _labelHeaders = new List(); private int? _labelIndex; private int? _maxPayloadInMB; private int? _maxRecordCount; private string _probabilityAttribute; private int? _probabilityIndex; /// /// Gets and sets the property ContentTemplate. /// /// A template string used to format a JSON record into an acceptable model container /// input. For example, a ContentTemplate string '{"myfeatures":$features}' /// will format a list of features [1,2,3] into the record string '{"myfeatures":[1,2,3]}'. /// Required only when the model container input is in JSON Lines format. /// /// [AWSProperty(Min=1, Max=64)] public string ContentTemplate { get { return this._contentTemplate; } set { this._contentTemplate = value; } } // Check to see if ContentTemplate property is set internal bool IsSetContentTemplate() { return this._contentTemplate != null; } /// /// Gets and sets the property FeatureHeaders. /// /// The names of the features. If provided, these are included in the endpoint response /// payload to help readability of the InvokeEndpoint output. See the Response /// section under Invoke the endpoint in the Developer Guide for more information. /// /// [AWSProperty(Min=1, Max=256)] public List FeatureHeaders { get { return this._featureHeaders; } set { this._featureHeaders = value; } } // Check to see if FeatureHeaders property is set internal bool IsSetFeatureHeaders() { return this._featureHeaders != null && this._featureHeaders.Count > 0; } /// /// Gets and sets the property FeaturesAttribute. /// /// Provides the JMESPath expression to extract the features from a model container input /// in JSON Lines format. For example, if FeaturesAttribute is the JMESPath /// expression 'myfeatures', it extracts a list of features [1,2,3] /// from request data '{"myfeatures":[1,2,3]}'. /// /// [AWSProperty(Min=1, Max=64)] public string FeaturesAttribute { get { return this._featuresAttribute; } set { this._featuresAttribute = value; } } // Check to see if FeaturesAttribute property is set internal bool IsSetFeaturesAttribute() { return this._featuresAttribute != null; } /// /// Gets and sets the property FeatureTypes. /// /// A list of data types of the features (optional). Applicable only to NLP explainability. /// If provided, FeatureTypes must have at least one 'text' /// string (for example, ['text']). If FeatureTypes is not provided, /// the explainer infers the feature types based on the baseline data. The feature types /// are included in the endpoint response payload. For additional information see the /// response /// section under Invoke the endpoint in the Developer Guide for more information. /// /// [AWSProperty(Min=1, Max=256)] public List FeatureTypes { get { return this._featureTypes; } set { this._featureTypes = value; } } // Check to see if FeatureTypes property is set internal bool IsSetFeatureTypes() { return this._featureTypes != null && this._featureTypes.Count > 0; } /// /// Gets and sets the property LabelAttribute. /// /// A JMESPath expression used to locate the list of label headers in the model container /// output. /// /// /// /// Example: If the model container output of a batch request is '{"labels":["cat","dog","fish"],"probability":[0.6,0.3,0.1]}', /// then set LabelAttribute to 'labels' to extract the list /// of label headers ["cat","dog","fish"] /// /// [AWSProperty(Min=1, Max=64)] public string LabelAttribute { get { return this._labelAttribute; } set { this._labelAttribute = value; } } // Check to see if LabelAttribute property is set internal bool IsSetLabelAttribute() { return this._labelAttribute != null; } /// /// Gets and sets the property LabelHeaders. /// /// For multiclass classification problems, the label headers are the names of the classes. /// Otherwise, the label header is the name of the predicted label. These are used to /// help readability for the output of the InvokeEndpoint API. See the response /// section under Invoke the endpoint in the Developer Guide for more information. /// If there are no label headers in the model container output, provide them manually /// using this parameter. /// /// [AWSProperty(Min=1, Max=16)] public List LabelHeaders { get { return this._labelHeaders; } set { this._labelHeaders = value; } } // Check to see if LabelHeaders property is set internal bool IsSetLabelHeaders() { return this._labelHeaders != null && this._labelHeaders.Count > 0; } /// /// Gets and sets the property LabelIndex. /// /// A zero-based index used to extract a label header or list of label headers from model /// container output in CSV format. /// /// /// /// Example for a multiclass model: If the model container output consists of /// label headers followed by probabilities: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"', /// set LabelIndex to 0 to select the label headers ['cat','dog','fish']. /// /// [AWSProperty(Min=0)] public int LabelIndex { get { return this._labelIndex.GetValueOrDefault(); } set { this._labelIndex = value; } } // Check to see if LabelIndex property is set internal bool IsSetLabelIndex() { return this._labelIndex.HasValue; } /// /// Gets and sets the property MaxPayloadInMB. /// /// The maximum payload size (MB) allowed of a request from the explainer to the model /// container. Defaults to 6 MB. /// /// [AWSProperty(Min=1, Max=25)] public int MaxPayloadInMB { get { return this._maxPayloadInMB.GetValueOrDefault(); } set { this._maxPayloadInMB = value; } } // Check to see if MaxPayloadInMB property is set internal bool IsSetMaxPayloadInMB() { return this._maxPayloadInMB.HasValue; } /// /// Gets and sets the property MaxRecordCount. /// /// The maximum number of records in a request that the model container can process when /// querying the model container for the predictions of a synthetic /// dataset. A record is a unit of input data that inference can be made on, for example, /// a single line in CSV data. If MaxRecordCount is 1, the model /// container expects one record per request. A value of 2 or greater means that the model /// expects batch requests, which can reduce overhead and speed up the inferencing process. /// If this parameter is not provided, the explainer will tune the record count per request /// according to the model container's capacity at runtime. /// /// [AWSProperty(Min=1)] public int MaxRecordCount { get { return this._maxRecordCount.GetValueOrDefault(); } set { this._maxRecordCount = value; } } // Check to see if MaxRecordCount property is set internal bool IsSetMaxRecordCount() { return this._maxRecordCount.HasValue; } /// /// Gets and sets the property ProbabilityAttribute. /// /// A JMESPath expression used to extract the probability (or score) from the model container /// output if the model container is in JSON Lines format. /// /// /// /// Example: If the model container output of a single request is '{"predicted_label":1,"probability":0.6}', /// then set ProbabilityAttribute to 'probability'. /// /// [AWSProperty(Min=1, Max=64)] public string ProbabilityAttribute { get { return this._probabilityAttribute; } set { this._probabilityAttribute = value; } } // Check to see if ProbabilityAttribute property is set internal bool IsSetProbabilityAttribute() { return this._probabilityAttribute != null; } /// /// Gets and sets the property ProbabilityIndex. /// /// A zero-based index used to extract a probability value (score) or list from model /// container output in CSV format. If this value is not provided, the entire model container /// output will be treated as a probability value (score) or list. /// /// /// /// Example for a single class model: If the model container output consists of /// a string-formatted prediction label followed by its probability: '1,0.6', /// set ProbabilityIndex to 1 to select the probability value /// 0.6. /// /// /// /// Example for a multiclass model: If the model container output consists of /// a string-formatted prediction label followed by its probability: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"', /// set ProbabilityIndex to 1 to select the probability values /// [0.1,0.6,0.3]. /// /// [AWSProperty(Min=0)] public int ProbabilityIndex { get { return this._probabilityIndex.GetValueOrDefault(); } set { this._probabilityIndex = value; } } // Check to see if ProbabilityIndex property is set internal bool IsSetProbabilityIndex() { return this._probabilityIndex.HasValue; } } }