成功使用 Azure 机器学习 API?

Successful consumption of a Azure Machine Learning API?

是否有人有关于在非 ASP.net 的 Web 应用程序中成功实施 Azure ML 工作室 API 的良好文档?我想在 运行 上加上 ruby 在 rails 上,但我想我必须自己弄清楚。

这只是一个休息 API 电话。看看这个...

data =  {

    "Inputs": {

            "input1":
            {
                "ColumnNames": ["YearBuild", "City", "State", "HomeType", "TaxAssesmentYear", "LotSize", "HomeSize", "NumBedrooms"],
                "Values": [ [ "0", "Anchorage", "AK        ", "Apartment", "0", "0", "0", "0" ], [ "0", "Anchorage", "AK        ", "Apartment", "0", "0", "0", "0" ], ]
            },        },
        "GlobalParameters": {
}
}

body = str.encode(json.dumps(data))

url = 'https://ussouthcentral.services.azureml.net/workspaces/45aeb4d8283d4be6ae211592f5366af5/services/07ffeeb6fcb84f16bc62cdcf67fd95b3/execute?api-version=2.0&details=true'
api_key = 'abc123' # Replace this with the API key for the web service
headers = {'Content-Type':'application/json', 'Authorization':('Bearer '+ api_key)}

req = urllib2.Request(url, body, headers) 

首先尝试使用 chrome 中的 postman 应用程序。设置你的 headers,就像上面一样,你的数据以 json 格式进入 post 有效负载。

在这里你会找到 Ruby 代码(不是 python)

      data = {
        'Inputs' => {
          'input1' => [
            {
              'weekday' => 1,
              'hour' => 2,
              'events' => 0 
            }
          ]
        },
        'GlobalParameters' => {}
      }
      body = data.to_json

      url = 'https://asiasoutheast.services.azureml.net/subscriptions/[tour stuff...]execute?api-version=2.0&format=swagger'
      api_key = '[your api key]'
      headers = {'Content-Type': 'application/json', 'Authorization': ('Bearer '+ api_key)}

      RestClient::Request.execute(method: :post, url: url, payload: body, headers: headers)