public class Prediction extends Object implements Serializable
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.
Constructor and Description |
---|
Prediction() |
Modifier and Type | Method and Description |
---|---|
Prediction |
adddetailsEntry(String key,
String value)
Provides any additional details regarding the prediction.
|
Prediction |
addpredictedScoresEntry(String key,
Float value)
Provides the raw classification score corresponding to each label.
|
Prediction |
cleardetailsEntries()
Removes all the entries added into details.
|
Prediction |
clearpredictedScoresEntries()
Removes all the entries added into predictedScores.
|
boolean |
equals(Object obj) |
Map<String,String> |
getDetails()
Provides any additional details regarding the prediction.
|
String |
getPredictedLabel()
The prediction label for either a
BINARY or
MULTICLASS MLModel . |
Map<String,Float> |
getPredictedScores()
Provides the raw classification score corresponding to each label.
|
Float |
getPredictedValue()
The prediction value for
REGRESSION MLModel . |
int |
hashCode() |
void |
setDetails(Map<String,String> details)
Provides any additional details regarding the prediction.
|
void |
setPredictedLabel(String predictedLabel)
The prediction label for either a
BINARY or
MULTICLASS MLModel . |
void |
setPredictedScores(Map<String,Float> predictedScores)
Provides the raw classification score corresponding to each label.
|
void |
setPredictedValue(Float predictedValue)
The prediction value for
REGRESSION MLModel . |
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Prediction |
withDetails(Map<String,String> details)
Provides any additional details regarding the prediction.
|
Prediction |
withPredictedLabel(String predictedLabel)
The prediction label for either a
BINARY or
MULTICLASS MLModel . |
Prediction |
withPredictedScores(Map<String,Float> predictedScores)
Provides the raw classification score corresponding to each label.
|
Prediction |
withPredictedValue(Float predictedValue)
The prediction value for
REGRESSION MLModel . |
public String getPredictedLabel()
The prediction label for either a BINARY
or
MULTICLASS
MLModel
.
Constraints:
Length: 1 -
The prediction label for either a BINARY
or
MULTICLASS
MLModel
.
public void setPredictedLabel(String predictedLabel)
The prediction label for either a BINARY
or
MULTICLASS
MLModel
.
Constraints:
Length: 1 -
predictedLabel
-
The prediction label for either a BINARY
or
MULTICLASS
MLModel
.
public Prediction withPredictedLabel(String predictedLabel)
The prediction label for either a BINARY
or
MULTICLASS
MLModel
.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
predictedLabel
-
The prediction label for either a BINARY
or
MULTICLASS
MLModel
.
public Float getPredictedValue()
REGRESSION
MLModel
.REGRESSION
MLModel
.public void setPredictedValue(Float predictedValue)
REGRESSION
MLModel
.predictedValue
- The prediction value for REGRESSION
MLModel
.public Prediction withPredictedValue(Float predictedValue)
REGRESSION
MLModel
.
Returns a reference to this object so that method calls can be chained together.
predictedValue
- The prediction value for REGRESSION
MLModel
.public Map<String,Float> getPredictedScores()
public void setPredictedScores(Map<String,Float> predictedScores)
predictedScores
- Provides the raw classification score
corresponding to each label.public Prediction withPredictedScores(Map<String,Float> predictedScores)
Returns a reference to this object so that method calls can be chained together.
predictedScores
- Provides the raw classification score
corresponding to each label.public Prediction addpredictedScoresEntry(String key, Float value)
The method adds a new key-value pair into predictedScores parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into predictedScores.value
- The corresponding value of the entry to be added into
predictedScores.public Prediction clearpredictedScoresEntries()
Returns a reference to this object so that method calls can be chained together.
public Map<String,String> getDetails()
public void setDetails(Map<String,String> details)
details
- Provides any additional details regarding the prediction.public Prediction withDetails(Map<String,String> details)
Returns a reference to this object so that method calls can be chained together.
details
- Provides any additional details regarding the prediction.public Prediction adddetailsEntry(String key, String value)
The method adds a new key-value pair into details parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into details.value
- The corresponding value of the entry to be added into
details.public Prediction cleardetailsEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString
in class Object
Object.toString()
Copyright © 2019. All rights reserved.