使用 Jupyter Notebook 探索 Azure 机器学习Explore Azure Machine Learning with Jupyter notebooks

备注

可在 https://github.com/Azure/azureml-examples 找到社区主导的示例存储库。A community-driven repository of examples can be found at https://github.com/Azure/azureml-examples.

示例 Azure 机器学习笔记本存储库包含最新的 Azure 机器学习 Python SDK 示例。The example Azure Machine Learning Notebooks repository includes the latest Azure Machine Learning Python SDK samples. 这些 Juypter 笔记本旨在帮助你浏览 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 文件夹中找到教程笔记本,在 how-to-use-azureml 文件夹中找到特定于功能的笔记本。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 机器学习计算实例的示例Get samples on Azure Machine Learning compute instance

若要开始使用示例,最简单的方法是完成教程:设置环境和工作区The easiest way to get started with the samples is to complete the Tutorial: Setup environment and workspace. 完成后,你就有了一个预先装载了 SDK 和示例存储库的专用笔记本服务器。Once completed, you'll have a dedicated notebook server pre-loaded with the SDK and the sample repository. 不需下载,也不需安装。No downloads or installation necessary.

获取笔记本服务器上的示例Get samples on your notebook server

若要自带笔记本服务器进行本地开发,请按照以下步骤操作:If you'd like to bring your own notebook server for local development, follow these steps:

  1. 按照 Azure 机器学习 SDK 中的说明安装适用于 Python 的 Azure 机器学习 SDKUse the instructions at Azure Machine Learning SDK to install the Azure Machine Learning SDK for Python

  2. 创建 Azure 机器学习工作区Create an Azure Machine Learning workspace.

  3. 编写一个配置文件 文件 (aml_config/config.json)。Write a configuration file file (aml_config/config.json).

  4. 克隆 GitHub 存储库Clone the GitHub repository.

    git clone https://github.com/Azure/MachineLearningNotebooks.git
    
  5. 从克隆目录启动 notebook 服务器。Start the notebook server from your cloned directory.

    jupyter notebook
    

这些说明会安装快速入门和教程笔记本所需的基础 SDK 包。These instructions install the base SDK packages necessary for the quickstart and tutorial notebooks. 其他示例笔记本可能需要安装额外组件。Other sample notebooks may require you to install extra components. 有关详细信息,请参阅安装适用于 Python 的 Azure 机器学习 SDKFor more information, see Install the Azure Machine Learning SDK for Python.

获取 DSVM 上的示例Get samples on DSVM

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 和笔记本服务器。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 机器学习工作区Create an Azure Machine Learning 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 笔记本中的代码创建新的工作区。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
    

后续步骤Next steps

浏览示例笔记本,了解 Azure 机器学习的功能。Explore the sample notebooks to discover what Azure Machine Learning can do.

有关 GitHub 示例项目和示例的详细信息,请参阅以下存储库:For more GitHub sample projects and examples, see these repos:

试用以下教程:Try these tutorials: