MachineLearning.Client.
predict
(**kwargs)¶Generates a prediction for the observation using the specified ML Model
.
Note: Not all response parameters will be populated. Whether a response parameter is populated depends on the type of model requested.
See also: AWS API Documentation
Request Syntax
response = client.predict(
MLModelId='string',
Record={
'string': 'string'
},
PredictEndpoint='string'
)
[REQUIRED]
A unique identifier of the MLModel
.
[REQUIRED]
A map of variable name-value pairs that represent an observation.
The name of a variable. Currently it's used to specify the name of the target value, label, weight, and tags.
The value of a variable. Currently it's used to specify values of the target value, weights, and tag variables and for filtering variable values.
dict
Response Syntax
{
'Prediction': {
'predictedLabel': 'string',
'predictedValue': ...,
'predictedScores': {
'string': ...
},
'details': {
'string': 'string'
}
}
}
Response Structure
(dict) --
Prediction (dict) --
The output from a Predict
operation:
Details
- Contains the following attributes: DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS
DetailsAttributes.ALGORITHM - SGD
PredictedLabel
- Present for either a BINARY
or MULTICLASS
MLModel
request.PredictedScores
- Contains the raw classification score corresponding to each label.PredictedValue
- Present for a REGRESSION
MLModel
request.predictedLabel (string) --
The prediction label for either a BINARY
or MULTICLASS
MLModel
.
predictedValue (float) --
The prediction value for REGRESSION
MLModel
.
predictedScores (dict) --
Provides the raw classification score corresponding to each label.
details (dict) --
Provides any additional details regarding the prediction.
(string) --
Contains the key values of DetailsMap
:
PredictiveModelType
- Indicates the type of the MLModel
.Algorithm
- Indicates the algorithm that was used for the MLModel
.Exceptions
MachineLearning.Client.exceptions.InvalidInputException
MachineLearning.Client.exceptions.ResourceNotFoundException
MachineLearning.Client.exceptions.LimitExceededException
MachineLearning.Client.exceptions.InternalServerException
MachineLearning.Client.exceptions.PredictorNotMountedException