从 Excel 使用 Azure 机器学习工作室(经典)Web 服务Consuming an Azure Machine Learning Studio (classic) Web Service from Excel

适用对象: 适用于.机器学习工作室(经典) 不适用于.Azure 机器学习APPLIES TO: Applies to.Machine Learning Studio (classic) Does not apply to.Azure Machine Learning

使用 Azure 机器学习工作室(经典)可以轻松地直接从 Excel 调用 Web 服务,而无需编写任何代码。Azure Machine Learning Studio (classic) makes it easy to call web services directly from Excel without the need to write any code.

如果使用的 Excel 2013 (或更高版本)或 Excel Online,则建议使用 Excel 的 Excel 加载项If you are using Excel 2013 (or later) or Excel Online, then we recommend that you use the Excel Excel add-in.

步骤Steps

发布 Web 服务。Publish a web service. 教程 3:部署信用风险模型说明如何执行此操作。Tutorial 3: Deploy credit risk model explains how to do it. 目前,仅具有单个输出(即单个评分标签)的请求/响应服务支持 Excel 工作簿功能。Currently the Excel workbook feature is only supported for Request/Response services that have a single output (that is, a single scoring label).

获得 Web 服务后,点击工作室左侧的 WEB SERVICES 部分,并从Excel 中选择要使用的 Web 服务。Once you have a web service, click on the WEB SERVICES section on the left of the studio, and then select the web service to consume from Excel.

经典 Web 服务Classic Web Service

  1. 在 Web 服务的“DASHBOARD”选项卡上有一行“REQUEST/RESPONSE”服务。On the DASHBOARD tab for the web service is a row for the REQUEST/RESPONSE service. 如果此服务具有单个输出,应在该行看到“下载 Excel 工作簿”链接。If this service had a single output, you should see the Download Excel Workbook link in that row.

    使用工作室(经典)Web 服务门户下载 Excel 工作簿

  2. 单击“下载 Excel 工作簿”。Click on Download Excel Workbook.

新的 Web 服务New Web Service

  1. 在 Azure 机器学习 Web 服务门户中,选择“使用”。In the Azure Machine Learning Web Service portal, select Consume.
  2. 在使用页上的“Web 服务使用选项”部分中,单击 Excel 图标。On the Consume page, in the Web service consumption options section, click the Excel icon.

使用工作簿Using the workbook

  1. 打开工作簿。Open the workbook.

  2. 系统会显示安全警告;单击“启用编辑”按钮。A Security Warning appears; click on the Enable Editing button.

    启用编辑以删除受保护的视图安全警告

  3. 系统会显示安全警告。A Security Warning appears. 单击“启用内容”按钮,在电子表格上运行宏。Click on the Enable Content button to run macros on your spreadsheet.

    启用内容以关闭禁用宏的安全警告

  4. 启用宏后,将生成一个表。Once macros are enabled, a table is generated. 要求将蓝色的列作为 RRS Web 服务的输入或 PARAMETERSColumns in blue are required as input into the RRS web service, or PARAMETERS. 注意,RRS 服务的输出,PREDICTED VALUES 为绿色。Note the output of the RRS service, PREDICTED VALUES in green. 给定行的所有列都填满时,工作簿会自动调用评分 API,并显示评分结果。When all columns for a given row are filled, the workbook automatically calls the scoring API, and displays the scored results.

    参数输入的表和生成的预测值

  5. 要对多行进行评分,请使用数据填充第二行,并生成预测值。To score more than one row, fill the second row with data and the predicted values are produced. 甚至可以一次粘贴多行。You can even paste several rows at once.

可以使用任何具有预测值的 Excel 功能(Graph、Power Map、条件格式等),帮助可视化数据。You can use any of the Excel features (graphs, power map, conditional formatting, etc.) with the predicted values to help visualize the data.

共享工作簿Sharing your workbook

若要能够使用宏,API 密钥必须是电子表格的一部分。For the macros to work, your API Key must be part of the spreadsheet. 这意味着应只与信任的实体/个人共享工作簿。That means that you should share the workbook only with entities/individuals you trust.

自动更新Automatic updates

在这两种情况进行 RRS 调用:An RRS call is made in these two situations:

  1. 第一次某行在其所有 PARAMETERS 中都有内容时The first time a row has content in all of its PARAMETERS
  2. 任何时候,输入了其所有 PARAMETERS 的行中的任一 PARAMETERS 发生更改时。Any time any of the PARAMETERS changes in a row that had all of its PARAMETERS entered.