Class: Google::Apis::PredictionV1_6::PredictionService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PredictionV1_6::PredictionService
- Defined in:
- generated/google/apis/prediction_v1_6/service.rb
Overview
Prediction API
Lets you access a cloud hosted machine learning service that makes it easy to build smart apps
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
-
#user_ip ⇒ String
IP address of the site where the request originates.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#analyze_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Analyze
Get analysis of the model and the data the model was trained on.
-
#delete_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Delete a trained model.
-
#get_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Insert2
Check training status of your model.
-
#initialize ⇒ PredictionService
constructor
A new instance of PredictionService.
-
#insert_trained_model(project, insert_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Insert2
Train a Prediction API model.
-
#list_trained_models(project, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::List
List available models.
-
#predict_hosted_model(project, hosted_model_name, input_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Output
Submit input and request an output against a hosted model.
-
#predict_trained_model(project, id, input_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Output
Submit model id and request a prediction.
-
#update_trained_model(project, id, update_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Insert2
Add new data to a trained model.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ PredictionService
Returns a new instance of PredictionService
52 53 54 55 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 52 def initialize super('https://www.googleapis.com/', 'prediction/v1.6/projects/') @batch_path = 'batch/prediction/v1.6' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
39 40 41 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 39 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
45 46 47 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 45 def quota_user @quota_user end |
#user_ip ⇒ String
Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.
50 51 52 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 50 def user_ip @user_ip end |
Instance Method Details
#analyze_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Analyze
Get analysis of the model and the data the model was trained on.
124 125 126 127 128 129 130 131 132 133 134 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 124 def analyze_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, '{project}/trainedmodels/{id}/analyze', ) command.response_representation = Google::Apis::PredictionV1_6::Analyze::Representation command.response_class = Google::Apis::PredictionV1_6::Analyze command.params['project'] = project unless project.nil? command.params['id'] = id unless id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#delete_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Delete a trained model.
162 163 164 165 166 167 168 169 170 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 162 def delete_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:delete, '{project}/trainedmodels/{id}', ) command.params['project'] = project unless project.nil? command.params['id'] = id unless id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#get_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Insert2
Check training status of your model.
198 199 200 201 202 203 204 205 206 207 208 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 198 def get_trained_model(project, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, '{project}/trainedmodels/{id}', ) command.response_representation = Google::Apis::PredictionV1_6::Insert2::Representation command.response_class = Google::Apis::PredictionV1_6::Insert2 command.params['project'] = project unless project.nil? command.params['id'] = id unless id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#insert_trained_model(project, insert_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Insert2
Train a Prediction API model.
235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 235 def insert_trained_model(project, insert_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, '{project}/trainedmodels', ) command.request_representation = Google::Apis::PredictionV1_6::Insert::Representation command.request_object = insert_object command.response_representation = Google::Apis::PredictionV1_6::Insert2::Representation command.response_class = Google::Apis::PredictionV1_6::Insert2 command.params['project'] = project unless project.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#list_trained_models(project, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::List
List available models.
276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 276 def list_trained_models(project, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, '{project}/trainedmodels/list', ) command.response_representation = Google::Apis::PredictionV1_6::List::Representation command.response_class = Google::Apis::PredictionV1_6::List command.params['project'] = project unless project.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#predict_hosted_model(project, hosted_model_name, input_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Output
Submit input and request an output against a hosted model.
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 84 def predict_hosted_model(project, hosted_model_name, input_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, '{project}/hostedmodels/{hostedModelName}/predict', ) command.request_representation = Google::Apis::PredictionV1_6::Input::Representation command.request_object = input_object command.response_representation = Google::Apis::PredictionV1_6::Output::Representation command.response_class = Google::Apis::PredictionV1_6::Output command.params['project'] = project unless project.nil? command.params['hostedModelName'] = hosted_model_name unless hosted_model_name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#predict_trained_model(project, id, input_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Output
Submit model id and request a prediction.
316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 316 def predict_trained_model(project, id, input_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, '{project}/trainedmodels/{id}/predict', ) command.request_representation = Google::Apis::PredictionV1_6::Input::Representation command.request_object = input_object command.response_representation = Google::Apis::PredictionV1_6::Output::Representation command.response_class = Google::Apis::PredictionV1_6::Output command.params['project'] = project unless project.nil? command.params['id'] = id unless id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |
#update_trained_model(project, id, update_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PredictionV1_6::Insert2
Add new data to a trained model.
357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'generated/google/apis/prediction_v1_6/service.rb', line 357 def update_trained_model(project, id, update_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:put, '{project}/trainedmodels/{id}', ) command.request_representation = Google::Apis::PredictionV1_6::Update::Representation command.request_object = update_object command.response_representation = Google::Apis::PredictionV1_6::Insert2::Representation command.response_class = Google::Apis::PredictionV1_6::Insert2 command.params['project'] = project unless project.nil? command.params['id'] = id unless id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? command.query['userIp'] = user_ip unless user_ip.nil? execute_or_queue_command(command, &block) end |