Class: NexosisApi::PredictResponse
- Inherits:
-
Object
- Object
- NexosisApi::PredictResponse
- Defined in:
- lib/nexosis_api/predict_response.rb
Overview
Class to hold the parsed response of a prediction request
Instance Attribute Summary collapse
-
#messages ⇒ Array
A list of warning message optionally returned from prediction run.
-
#model_id ⇒ String
readonly
The unique identifier for the model used to create these predictions.
-
#predictions ⇒ Array of Hash
The feature data along with predicted target value along with the target column containing the values predicted.
Instance Method Summary collapse
-
#initialize(model_id, response_hash) ⇒ PredictResponse
constructor
A new instance of PredictResponse.
Constructor Details
#initialize(model_id, response_hash) ⇒ PredictResponse
Returns a new instance of PredictResponse.
5 6 7 8 9 |
# File 'lib/nexosis_api/predict_response.rb', line 5 def initialize(model_id, response_hash) @model_id = model_id @predictions = response_hash['data'] @message = response_hash['messages'] end |
Instance Attribute Details
#messages ⇒ Array
A list of warning message optionally returned from prediction run
33 34 35 |
# File 'lib/nexosis_api/predict_response.rb', line 33 def @messages end |
#model_id ⇒ String (readonly)
The unique identifier for the model used to create these predictions
13 14 15 |
# File 'lib/nexosis_api/predict_response.rb', line 13 def model_id @model_id end |
#predictions ⇒ Array of Hash
Note:
The result data includes an echo of the data sent to the predict request
The feature data along with predicted target value along with the target column containing the values predicted. [
{
"feature1": 23.33,
"target": 2.59
},
{
"feature1": 15.82,
"target": 1.75
}
]
29 30 31 |
# File 'lib/nexosis_api/predict_response.rb', line 29 def predictions @predictions end |