MachineLearning / Client / predict
predict#
- 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' )
- Parameters:
MLModelId (string) –
[REQUIRED]
A unique identifier of the
MLModel.Record (dict) –
[REQUIRED]
A map of variable name-value pairs that represent an observation.
(string) –
The name of a variable. Currently it’s used to specify the name of the target value, label, weight, and tags.
(string) –
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.
PredictEndpoint (string) – [REQUIRED]
- Return type:
dict
- Returns:
Response Syntax
{ 'Prediction': { 'predictedLabel': 'string', 'predictedValue': ..., 'predictedScores': { 'string': ... }, 'details': { 'string': 'string' } } }
Response Structure
(dict) –
Prediction (dict) –
The output from a
Predictoperation:Details- Contains the following attributes:DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASSDetailsAttributes.ALGORITHM - SGDPredictedLabel- Present for either aBINARYorMULTICLASSMLModelrequest.PredictedScores- Contains the raw classification score corresponding to each label.PredictedValue- Present for aREGRESSIONMLModelrequest.
predictedLabel (string) –
The prediction label for either a
BINARYorMULTICLASSMLModel.predictedValue (float) –
The prediction value for
REGRESSIONMLModel.predictedScores (dict) –
Provides the raw classification score corresponding to each label.
(string) –
(float) –
details (dict) –
Provides any additional details regarding the prediction.
(string) –
Contains the key values of
DetailsMap:PredictiveModelType- Indicates the type of theMLModel.Algorithm- Indicates the algorithm that was used for theMLModel.
(string) –
Exceptions
MachineLearning.Client.exceptions.InvalidInputExceptionMachineLearning.Client.exceptions.ResourceNotFoundExceptionMachineLearning.Client.exceptions.LimitExceededExceptionMachineLearning.Client.exceptions.InternalServerExceptionMachineLearning.Client.exceptions.PredictorNotMountedException