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()
MLModel
.
Constraints:
Length: 1 -
MLModel
.public void setPredictedLabel(String predictedLabel)
MLModel
.
Constraints:
Length: 1 -
predictedLabel
- The prediction label for either a BINARY or MULTICLASS
MLModel
.public Prediction withPredictedLabel(String predictedLabel)
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()
MLModel
.MLModel
.public void setPredictedValue(Float predictedValue)
MLModel
.predictedValue
- The prediction value for REGRESSION MLModel
.public Prediction withPredictedValue(Float predictedValue)
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 © 2015. All rights reserved.