Google Prediction API (約100 MB) を使用して大量のデータを一括で予測する方法はありますか? Google Cloud Storage に保存されたデータを使用してモデルをトレーニングできることがわかりました。Google Cloud Storage に保存されているファイルに基づいて予測を行うことはできますか?
1 に答える
0
はい、うまくいきます。以下に Python コード サンプルを用意しました。
# Get predefined credentials (see https://cloud.google.com/sdk/gcloud/#gcloud.auth)
http = AppAssertionCredentials('https://www.googleapis.com/auth/prediction').authorize(httplib2.Http())
# Create a service for the Prediction API
service = build('prediction', 'v1.6', http=http)
# Define body to create a new model with a URL to the CSV files stored in GCP Cloud Storage
request_body = {"id": "<ModelID>", "storageDataLocation": <bucket_with_filename>}
# Execute command
return service.trainedmodels().insert(project='<ProjectID>', body=request_body).execute()
于 2015-06-24T16:40:26.567 に答える