代码之家  ›  专栏  ›  技术社区  ›  gogasca

CMLE是否为预测提供RESTAPI端点?

  •  0
  • gogasca  · 技术社区  · 7 年前

    对于由CloudML引擎创建的模型,有没有一种方法可以访问RESTAPI端点?我只看到:

    gcloud ml-engine jobs submit prediction $JOB_NAME \
        --model census \
        --version v1 \
        --data-format TEXT \
        --region $REGION \
        --runtime-version 1.10 \
        --input-paths gs://cloud-samples-data/ml-engine/testdata/prediction/census.json \
        --output-path $GCS_JOB_DIR/predictions
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   David    7 年前

    1. projects.predict call request as described here

    2. projects.jobs.create call predictionInput and predictionOutput fields

      POST https://ml.googleapis.com/v1/projects/$PROJECT_ID/jobs
      
      {
        "jobId" : "$JOB_NAME",
        "predictionInput": {
          "dataFormat": "TEXT",
          "inputPaths": "gs://cloud-samples-data/ml-engine/testdata/prediction/census.json",
          "region": "REGION",
          "runtimeVersion": "1.10",
          "modelName": "projects/$PROJECT_ID/models/census"
        },
        "predictionOutput": {
          "outputPath": "$GCS_JOB_DIR/predictions"
        }
      }
      

      projects.jobs.get

    推荐文章