Class: Datarobot::AiApi::Prediction
- Inherits:
-
Object
- Object
- Datarobot::AiApi::Prediction
- Defined in:
- lib/datarobot/ai_api/prediction.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#prediction ⇒ Object
readonly
Returns the value of attribute prediction.
-
#row_id ⇒ Object
readonly
Returns the value of attribute row_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Prediction
constructor
Takes a response body from the API.
Constructor Details
#initialize(options = {}) ⇒ Prediction
Takes a response body from the API. Will set all prediction attributes from the response body
10 11 12 13 14 15 16 17 |
# File 'lib/datarobot/ai_api/prediction.rb', line 10 def initialize(={}) # one-liner replacement for `stringify_keys` = .collect{|k,v| [k.to_s, v]}.to_h @prediction = .dig("prediction") @row_id = .dig("rowId") @data = .dig("data") end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/datarobot/ai_api/prediction.rb', line 4 def data @data end |
#prediction ⇒ Object (readonly)
Returns the value of attribute prediction.
4 5 6 |
# File 'lib/datarobot/ai_api/prediction.rb', line 4 def prediction @prediction end |
#row_id ⇒ Object (readonly)
Returns the value of attribute row_id.
4 5 6 |
# File 'lib/datarobot/ai_api/prediction.rb', line 4 def row_id @row_id end |