使用 Jupyter Notebook 探索 Azure Machine Learning 服務Use Jupyter notebooks to explore Azure Machine Learning service

Azure Machine Learning Notebook 存放庫包含最新的 Azure Machine Learning Python SDK 範例。The Azure Machine Learning Notebooks repository includes the latest Azure Machine Learning Python SDK samples. 這些 Juypter Notebook 可協助您探索 SDK,並且可供您自己的機器學習服務專案作為模型。These Juypter notebooks are designed to help you explore the SDK and serve as models for your own machine learning projects.

本文說明如何從下列環境存取存放庫:This article shows you how to access the repository from the following environments:

注意

在複製存放庫之後,您可在 tutorials 資料夾中找到教學課程 Notebook,並且可在 how-to-use-azureml 資料夾中找到特定功能的 Notebook。Once you've cloned the repository, you'll find tutorial notebooks in the tutorials folder and feature-specific notebooks in the how-to-use-azureml folder.

Azure Machine Learning Notebook VMAzure Machine Learning Notebook VM

要開始使用範例,最簡單的方式是完成雲端式 Notebook 快速入門The easiest way to get started with the samples is to complete the cloud-based notebook quickstart. 完成後,您將會有已預先載入 SDK 與範例存放庫的專用 Notebook 伺服器。Once completed, you'll have a dedicated notebook server pre-loaded with the SDK and the sample repository. 您不需要下載或安裝。No downloads or installation necessary.

自攜 Jupyter Notebook 伺服器Bring your own Jupyter Notebook server

如果您想要使用攜帶的 Notebook 伺服器進行本機開發,請遵循下列步驟:If you'd like to bring your own notebook server for local development, follow these steps:

  1. 依照建立 Azure Machine Learning 服務工作區中的指示執行下列工作:Use the instructions at Create an Azure Machine Learning service workspace to do the following:

    • 建立 Miniconda 環境Create a Miniconda environment
    • 安裝適用於 Python 的 Azure Machine Learning SDKInstall the Azure Machine Learning SDK for Python
    • 建立工作區Create a workspace
    • 撰寫工作區設定檔 (aml_config/config.json)。Write a workspace configuration file (aml_config/config.json).
  2. 複製 GitHub 存放庫Clone the GitHub repository.

    git clone https://github.com/Azure/MachineLearningNotebooks.git
    
  3. 從複製的目錄中啟動 Notebook 伺服器。Start the notebook server from your cloned directory.

    jupyter notebook
    

這些指示會安裝快速入門和教學課程 Notebook 所需的基底 SDK 套件。These instructions install the base SDK packages necessary for the quickstart and tutorial notebooks. 若要使用其他範例 Notebook,可能需要安裝額外的元件。Other sample notebooks may require you to install extra components. 如需詳細資訊,請參閱安裝適用於 Python 的 Azure Machine Learning SDKFor more information, see Install the Azure Machine Learning SDK for Python.

資料科學虛擬機器Data Science Virtual Machine

資料科學虛擬機器 (DSVM) 是專為進行資料科學而建置的自訂 VM 映像。The Data Science Virtual Machine (DSVM) is a customized VM image built specifically for doing data science. 如果您建立 DSVM,系統將為您安裝及設定 SDK 和 Notebook 伺服器。If you create a DSVM, the SDK and notebook server are installed and configured for you. 不過,您仍須建立工作區並複製範例存放庫。However, you'll still need to create a workspace and clone the sample repository.

  1. 建立 Azure Machine Learning 服務工作區Create an Azure Machine Learning service workspace.

  2. 複製 GitHub 存放庫Clone the GitHub repository.

    git clone https://github.com/Azure/MachineLearningNotebooks.git
    
  3. 使用以下其中一種方法將工作區組態檔新增至複製的目錄:Add a workspace configuration file to the cloned directory using either of these methods:

    • Azure 入口網站中,從您工作區的 [概觀] 區段選取 [下載 config.json] 。In the Azure portal, select Download config.json from the Overview section of your workspace.

    下載 config.json

    • 使用 configuration.ipynb Notebook 中的程式碼在您複製的目錄中建立新的工作區。Create a new workspace using code in the configuration.ipynb notebook in your cloned directory.
  4. 從複製的目錄中啟動 Notebook 伺服器。Start the notebook server from your cloned directory.

    jupyter notebook
    

Azure NotebooksAzure Notebooks

Azure Notebooks 上,系統會為您安裝及設定 SDK 和 Notebook 伺服器。On Azure Notebooks, the SDK and notebook server are installed and configured for you. Azure Notebook 提供受到完整管理的輕量型 Notebook 環境讓您探索。Azure Notebooks provides a fully-managed, lightweight notebook environment for you to explore.

若要存取 Azure Notebooks 上的範例存放庫,請透過 Azure 入口網站瀏覽至您的 Azure Machine Learning 工作區。To access the sample repository on Azure Notebooks, navigate to your Azure Machine Learning workspace through the Azure portal. 從 [概觀] 區段中選取 [開始使用 Azure Notebooks] 。From the Overview section, select Get Started in Azure Notebooks.

後續步驟Next steps

瀏覽範例 Notebook 以探索 Azure Machine Learning 服務的功用,或嘗試進行下列教學課程:Explore the sample notebooks to discover what Azure Machine Learning service can do, or try these tutorials: