建立 Azure Machine Learning 預覽帳戶,並安裝 Azure Machine Learning WorkbenchCreate Azure Machine Learning Preview accounts and install Azure Machine Learning Workbench

Azure Machine Learning 服務 (預覽) 是整合、端對端的資料科學和進階分析解決方案。Azure Machine Learning services (preview) is an integrated, end-to-end data science and advanced analytics solution. 它可以協助專業資料科學家以雲端規模準備資料、開發測試及部署模型。It helps professional data scientists to prepare data, develop experiments, and deploy models at cloud scale.

本快速入門示範如何在 Azure Machine Learning 預覽中建立測試與模型管理帳戶。This Quickstart shows you how to create experimentation and model management accounts in Azure Machine Learning Preview. 它也會顯示如何安裝 Azure Machine Learning Workbench 桌面應用程式和 CLI 工具。It also shows you how to install the Azure Machine Learning Workbench desktop application and CLI tools. 接下來,您可以使用鳶尾花資料集快速導覽 Azure Machine Learning 預覽功能來建置模型,以根據部分實體特性預測鳶尾花的類型。Next, you take a quick tour of Azure Machine Learning Preview features by using the Iris flower dataset to build a model that predicts the type of iris based on some of its physical characteristics.

如果您沒有 Azure 訂用帳戶,請在開始前建立 免費帳戶If you don't have an Azure subscription, create a free account before you begin.

先決條件Prerequisites

目前,您只能將 Azure Machine Learning Workbench 桌面應用程式安裝在下列作業系統上:Currently, you can install the Azure Machine Learning Workbench desktop app on only the following operating systems:

  • Windows 10Windows 10
  • Windows Server 2016Windows Server 2016
  • macOS SierramacOS Sierra
  • macOS High SierramacOS High Sierra

登入 Azure 入口網站Sign in to the Azure portal

登入 Azure 入口網站Sign in to the Azure portal.

建立 Azure Machine Learning 帳戶Create Azure Machine Learning accounts

使用 Azure 入口網站來佈建 Azure Machine Learning 帳戶:Use the Azure portal to provision Azure Machine Learning accounts:

  1. 選取入口網站左上角的 [新增] 按鈕 (+)。Select the New button (+) in the upper-left corner of the portal.

  2. 在搜尋列中輸入「Machine Learning」。Enter Machine Learning in the search bar. 選取名為 Machine Learning 測試 (預覽) 的搜尋結果。Select the search result named Machine Learning Experimentation (preview). 按一下星星圖示,讓此選取項目成為 Azure 入口網站中的我的最愛。Click the star icon to make this selection a favorite in the Azure portal.

    Azure Machine Learning 搜尋

  3. 選取 [+ 新增] 來設定新的 Machine Learning 測試帳戶。Select + Add to configure a new Machine Learning Experimentation account. 詳細表單隨即開啟。The detailed form opens.

    Machine Learning 測試帳戶

  4. 使用下列資訊填寫 Machine Learning 測試表單:Fill out the Machine Learning Experimentation form with the following information:

    設定Setting 建議的值Suggested value 說明Description
    測試帳戶名稱Experimentation account name 唯一的名稱Unique name 選擇可識別您帳戶的唯一名稱。Choose a unique name that identifies your account. 您可以使用您自己的名稱,或最能識別測試的部門或專案名稱。You can use your own name, or a departmental or project name that best identifies the experiment. 這個名稱長度應介於 2 到 32 個字元之間。The name should be 2 to 32 characters. 應該只包含英數字元及虛線 (-) 字元。It should include only alphanumeric characters and the dash (-) character.
    訂用帳戶Subscription 您的訂用帳戶Your subscription 選擇您要用於測試的 Azure 訂用帳戶。Choose the Azure subscription that you want to use for your experiment. 如果您有多個訂用帳戶,請選擇資源計費的適當訂用帳戶。If you have multiple subscriptions, choose the appropriate subscription in which the resource is billed.
    資源群組Resource group 您的資源群組Your resource group 您可以產生新的資源群組名稱,或使用您訂用帳戶中現有的資源群組名稱。You can make a new resource group name, or you can use an existing one from your subscription.
    位置Location 最接近使用者的區域The region closest to your users 選擇最接近您的使用者與資料資源的位置。Choose the location that's closest to your users and the data resources.
    基座數目Number of seats 22 輸入基座數目。Enter the number of seats. 此選項會影響定價This selection affects the pricing. 前兩個基座是免費的。The first two seats are free. 基於本快速入門的目的,我們使用兩個基座。Use two seats for the purposes of this Quickstart. 您稍後可以視需要在 Azure 入口網站中更新基座數目。You can update the number of seats later as needed in the Azure portal.
    儲存體帳戶Storage account 唯一的名稱Unique name 選取 [建立新項目],並且提供名稱以建立 Azure 儲存體帳戶。Select Create new and provide a name to create an Azure storage account. 或者,選取 [使用現有的] ,然後從下拉式清單選取現有的儲存體帳戶。Or, select Use existing and select your existing storage account from the drop-down list. 需要儲存體帳戶,並且是用來儲存專案構件並執行歷程記錄資料。The storage account is required and is used to hold project artifacts and run history data.
    測試帳戶的工作區Workspace for Experimentation account 唯一的名稱Unique name 提供新工作區的名稱。Provide a name for the new workspace. 這個名稱長度應介於 2 到 32 個字元之間。The name should be 2 to 32 characters. 應該只包含英數字元及虛線 (-) 字元。It should include only alphanumeric characters and the dash (-) character.
    指派工作區的擁有者Assign owner for the workspace 您的帳戶Your account 選取您自己的帳戶作為工作區擁有者。Select your own account as the workspace owner.
    建立模型管理帳戶Create Model Management account 檢查check 作為測試帳戶建立體驗的一部分,您也可以選擇建立 Machine Learning 模型管理帳戶。As part of the Experimentation account creation experience, you have the option of also creating the Machine Learning Model Management account. 在您在準備好要將您的模型部署和管理為即時 Web 服務時,會使用此資源。This resource is used when you're ready to deploy and manage your models as real-time web services. 建議您在與測試帳戶的同時建立模型管理帳戶。We recommend creating the Model Management account at the same time as the Experimentation account.
    帳戶名稱Account name 唯一的名稱Unique name 選擇可識別您模型管理員帳戶的唯一名稱。Choose a unique name that identifies your Model Management account. 您可以使用您自己的名稱,或最能識別測試的部門或專案名稱。You can use your own name, or a departmental or project name that best identifies the experiment. 這個名稱長度應介於 2 到 32 個字元之間。The name should be 2 to 32 characters. 應該只包含英數字元及虛線 (-) 字元。It should include only alphanumeric characters and the dash (-) character.
    模型管理定價層Model Management pricing tier DEVTESTDEVTEST 選取 [未選取任何定價層] 來指定新模型管理帳戶的定價層。Select No pricing tier selected to specify the pricing tier for your new Model Management account. 為了節省成本,請選取 DEVTEST 定價層 (如果在您的訂用帳戶上可用,限量提供)。For cost savings, select the DEVTEST pricing tier if it's available on your subscription (limited availability). 否則請選取 S1 定價層以節省成本。Otherwise, select the S1 pricing tier for cost savings. 按一下 [選取] 以儲存定價層選取項目。Click Select to save the pricing tier selection.
    釘選到儀表板Pin to dashboard 檢查check 選取 [釘選到儀表板] 選項,在 Azure 入口網站的前儀表板頁面上輕鬆追蹤 Machine Learning 測試帳戶。Select the Pin to dashboard option to allow easy tracking of your Machine Learning Experimentation account on the front dashboard page of the Azure portal.
  5. 選取 [建立] 來開始建立程序。Select Create to begin the creation process.

  6. 在 Azure 入口網站工具列上,按一下 [通知] (鈴鐺圖示) 來監視部署程序。On the Azure portal toolbar, click Notifications (bell icon) to monitor the deployment process.

    通知會顯示「部署進行中」。The notification shows Deployment in progress. 一旦完成,狀態會變更為「部署已成功」。The status changes to Deployment succeeded when it's done. Machine Learning 測試帳戶頁面會在成功時開啟。Your Machine Learning Experimentation account page opens upon success.

    Azure 入口網站通知

現在,根據您在本機電腦上使用的作業系統,請遵循下面兩個區段中的一個,安裝 Azure Machine Learning Workbench。Now, depending on which operating system you use on your local computer, follow one of the next two sections to install Azure Machine Learning Workbench.

在 Windows 上安裝 Azure Machine Learning WorkbenchInstall Azure Machine Learning Workbench on Windows

在執行 Windows 10、Windows Server 2016 或更新版本的電腦上安裝 Azure Machine Learning Workbench。Install Azure Machine Learning Workbench on your computer running Windows 10, Windows Server 2016, or newer.

  1. 下載最新的 Azure Machine Learning Workbench 安裝程式 AmlWorkbenchSetup.msiDownload the latest Azure Machine Learning Workbench installer AmlWorkbenchSetup.msi.

  2. 從檔案總管按兩下所下載的安裝程式 AmlWorkbenchSetup.msiDouble-click the downloaded installer AmlWorkbenchSetup.msi from File Explorer.

    重要

    在磁碟上完整下載安裝程式,然後從該處執行它。Download the installer fully on disk, and then run it from there. 不要直接從瀏覽器的下載小工具執行它。Do not run it directly from your browser's download widget.

  3. 遵循螢幕上的指示完成安裝。Finish the installation by following the on-screen instructions.

    安裝程式會下載所有必要的相依元件,例如 Python、Miniconda 及其他相關程式庫。The installer downloads all the necessary dependent components, such as Python, Miniconda, and other related libraries. 安裝可能需要約半小時才能完成所有元件。The installation might take around half an hour to finish all the components.

  4. Azure Machine Learning Workbench 現在已安裝在下列目錄:Azure Machine Learning Workbench is now installed in the following directory:

    C:\Users\<user>\AppData\Local\AmlWorkbench

在 macOS 上安裝 Azure Machine Learning WorkbenchInstall Azure Machine Learning Workbench on macOS

在執行 macOS Sierra 或更新版本的電腦上安裝 Azure Machine Learning Workbench。Install Azure Machine Learning Workbench on your computer running macOS Sierra or later.

  1. 下載最新的 Azure Machine Learning Workbench 安裝程式 AmlWorkbench.dmgDownload the latest Azure Machine Learning Workbench installer, AmlWorkbench.dmg.

    重要

    在磁碟上完整下載安裝程式,然後從該處執行它。Download the installer fully on disk, and then run it from there. 不要直接從瀏覽器的下載小工具執行它。Do not run it directly from your browser's download widget.

  2. 從 Finder 按兩下所下載的安裝程式 AmlWorkbench.dmgDouble-click the downloaded installer AmlWorkbench.dmg from Finder.

  3. 遵循螢幕上的指示完成安裝。Finish the installation by following the on-screen instructions.

    安裝程式會下載所有必要的相依元件,例如 Python、Miniconda 及其他相關程式庫。The installer downloads all the necessary dependent components, such as Python, Miniconda, and other related libraries. 安裝可能需要約半小時才能完成所有元件。The installation might take around half an hour to finish all the components.

  4. Azure Machine Learning Workbench 現在已安裝在下列目錄:Azure Machine Learning Workbench is now installed in the following directory:

    /Applications/Azure ML Workbench.app

執行 Azure Machine Learning Workbench 以第一次登入Run Azure Machine Learning Workbench to sign in for the first time

  1. 安裝程序完成之後,請選取安裝程式之最後一個畫面上的 [啟動 Workbench] 按鈕。After the installation process is complete, select the Launch Workbench button on the last screen of the installer. 如果您已關閉安裝程式,請在桌面和 [開始] 功能表上尋找名為 Azure Machine Learning Workbench 的 Machine Learning Workbench 捷徑,來啟動應用程式。If you have closed the installer, find the shortcut to Machine Learning Workbench on your desktop and Start menu named Azure Machine Learning Workbench to start the app.

  2. 使用您稍早用來佈建您的 Azure 資源的相同帳戶登入 Workbench。Sign in to Workbench by using the same account that you used earlier to provision your Azure resources.

  3. 登入程序成功時,Workbench 會嘗試尋找您稍早建立的 Machine Learning 測試帳戶。When the sign-in process has succeeded, Workbench attempts to find the Machine Learning Experimentation accounts that you created earlier. 它會搜尋您的認證具有存取權的所有 Azure 訂用帳戶。It searches for all Azure subscriptions to which your credential has access. 找到至少一個測試帳戶時,即會使用該帳戶開啟 Workbench。When at least one Experimentation account is found, Workbench opens with that account. 然後它會列出在該帳戶中找到的工作區和專案。It then lists the workspaces and projects found in that account.

    提示

    如果您有一個以上的測試帳戶的存取權,可以選取 Workbench 應用程式左下角的圖像圖示,切換為另一個帳戶。If you have access to more than one Experimentation account, you can switch to a different one by selecting the avatar icon in the lower-left corner of the Workbench app.

如需建立用於部署 Web 服務之環境的詳細資訊,請參閱部署環境設定For information about creating an environment for deploying your web services, see Deployment environment setup.

建立新專案Create a new project

  1. 啟動 Azure Machine Learning Workbench 應用程式並登入。Start the Azure Machine Learning Workbench app and sign in.

  2. 選取 [檔案] > [新專案] (或是選取 + 登入 [專案] 窗格)。Select File > New Project (or select the + sign in the PROJECTS pane).

  3. 填寫 [專案名稱] 和 [專案目錄] 方塊。Fill in the Project name and Project directory boxes. [專案描述] 為選擇性,但是很有幫助。Project description is optional but helpful. 目前將 Visualstudio.com GIT 存放庫 URL 方塊保持空白。Leave the Visualstudio.com GIT Repository URL box blank for now. 選擇工作區,然後選取 [分類鳶尾花] 作為專案範本。Choose a workspace, and select Classifying Iris as the project template.

    提示

    (選擇性) 您可以使用 Visual Studio Team Services 專案中裝載的 Git 存放庫的 URL 來填入 Git 存放庫文字方塊。Optionally, you can fill in the Git repo text box with the URL of a Git repo that is hosted in a Visual Studio Team Services project. 這個 Git 儲存機制必須已經存在,且必須是空的且沒有主要分支。This Git repo must already exist, and it must be empty with no master branch. 而且,您必須具有其寫入權限。And you must have write access to it. 現在新增 Git 儲存機制,可讓您稍後啟用漫遊及共用案例。Adding a Git repo now lets you enable roaming and sharing scenarios later. 閱讀更多資訊Read more.

  4. 選取 [建立] 按鈕以建立專案。Select the Create button to create the project. 隨即為您建立並開啟新的專案。A new project is created and opened for you. 此時,您可以瀏覽專案首頁、資料來源、筆記本及原始程式檔。At this point, you can explore the project home page, data sources, notebooks, and source code files.

    提示

    您也可以僅僅藉由設定整合式開發環境 (IDE) 連結,在 Visual Studio Code 或其他編輯器中開啟專案,然後再開啟其中的專案目錄。You can also open the project in Visual Studio Code or other editors simply by configuring an integrated development environment (IDE) link, and then opening the project directory in it. 閱讀更多資訊Read more.

執行 Python 指令碼Run a Python script

讓我們在本機電腦上執行指令碼。Let's run a script on your local computer.

  1. 每個專案會開啟到自己的 [專案儀表板] 頁面。Each project opens to its own Project Dashboard page. 從接近應用程式最上方的命令列選取 local 作為執行目標,以及選取 iris_sklearn.py 作為要執行的指令碼。Select local as the execution target from the command bar near the top of the application, and select iris_sklearn.py as the script to run. 範例中包含其他檔案,可供您稍後簽出。There are other files included in the sample that you can check out later.

    命令列

  2. 在 [引數] 文字方塊中輸入 0.01In the Arguments text box, enter 0.01. 這個數字用於程式碼中,以設定正規化速率。This number is used in the code to set the regularization rate. 它是用來設定如何定型線性迴歸模型的值。It's a value that's used to configure how the linear regression model is trained.

  3. 選取 [執行] 按鈕以開始在您的電腦上執行 iris_sklearn.pySelect the Run button to begin running iris_sklearn.py on your computer.

    此程式碼使用來自受歡迎的 Python scikit-learn 程式庫的羅吉斯迴歸演算法來建置模型。This code uses the logistic regression algorithm from the popular Python scikit-learn library to build the model.

  4. [作業] 面板會從右邊滑出 (如果尚不可見),且 iris_sklearn 作業會在面板中新增。The Jobs panel slides out from the right if it is not already visible, and an iris_sklearn job is added in the panel. 隨著作業開始執行,其狀態會從提交中轉換為執行中,然後在幾秒後變成已完成Its status transitions from Submitting to Running as the job begins to run, and then to Completed in a few seconds.

    恭喜!Congratulations. 您已成功在 Azure Machine Learning Workbench 中執行 Python 指令碼。You have successfully executed a Python script in Azure Machine Learning Workbench.

  5. 重複步驟 2-4 數次。Repeat steps 2 to 4 several times. 每次都使用不同的引數值,範圍從 100.001Each time, use different argument values that range from 10 to 0.001.

檢視執行歷程記錄View run history

  1. 移至 [執行] 檢視,然後選取執行清單中的 iris_sklearn.pyGo to the Runs view, and select iris_sklearn.py in the run list. iris_sklearn.py 的執行歷程記錄儀表板隨即開啟。The run history dashboard for iris_sklearn.py opens. 它會顯示在 iris_sklearn.py 上的每次執行。It shows every run that was executed on iris_sklearn.py.

    執行歷程記錄儀表板

  2. 執行歷程記錄儀表板也會顯示最上層度量、一組預設圖形和每個執行度量的清單。The run history dashboard also displays the top metrics, a set of default graphs, and a list of metrics for each run. 您可以藉由排序、篩選和調整設定來自訂此檢視。You can customize this view by sorting, filtering, and adjusting the configurations. 只要選取設定圖示或篩選圖示。Just select the configuration icon or the filter icon.

    計量和圖表

  3. 選取已完成的執行,您可以看到該特定執行的詳細檢視。Select a completed run, and you can see a detailed view for that specific execution. 詳細資料包括其他計量、它所產生的檔案和其他有用的記錄。Details include additional metrics, the files that it produced, and other potentially useful logs.

後續步驟Next steps

您現在已成功建立 Azure Machine Learning 測試帳戶和 Azure Machine Learning 模型管理帳戶。You have now successfully created an Azure Machine Learning Experimentation account and an Azure Machine Learning Model Management account. 您已安裝 Azure Machine Learning Workbench 桌面應用程式和命令列介面。You have installed the Azure Machine Learning Workbench desktop app and command-line interface. 您已透過執行指令碼建立新的專案、建立模型,並探索指令碼的執行歷程記錄。You have created a new project, created a model by running a script, and explored the run history of the script.

如需此工作流程的更深入體驗,包括如何將鳶尾花模型部署為 Web 服務,請遵循完整的「分類鳶尾花」教學課程。For a more in-depth experience of this workflow, including how to deploy your Iris model as a web service, follow the full-length Classifying Iris tutorial. 本教學課程包含資料準備測試模型管理的詳細步驟。The tutorial contains detailed steps for data preparation, experimentation, and model management.