Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 1.0.10 #182

Merged
merged 3 commits into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 16 additions & 37 deletions NBSETUP.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Setting up environment
# Notebook setup

---

To run the notebooks in this repository use one of the two options.
To run the notebooks in this repository use one of these methods:

## Option 1: Use Azure Notebooks
Azure Notebooks is a hosted Jupyter-based notebook service in the Azure cloud. Azure Machine Learning Python SDK is already pre-installed in the Azure Notebooks `Python 3.6` kernel.
## Use Azure Notebooks - Jupyter based notebooks in the Azure cloud

1. [![Azure Notebooks](https://notebooks.azure.com/launch.png)](https://aka.ms/aml-clone-azure-notebooks)
[Import sample notebooks ](https://aka.ms/aml-clone-azure-notebooks) into Azure Notebooks
Expand All @@ -16,40 +15,20 @@ Azure Notebooks is a hosted Jupyter-based notebook service in the Azure cloud. A

![set kernel to Python 3.6](images/python36.png)

## **Option 2: Use your own notebook server**
## **Use your own notebook server**

### Quick installation
We recommend you create a Python virtual environment ([Miniconda](https://conda.io/miniconda.html) preferred but [virtualenv](https://virtualenv.pypa.io/en/latest/) works too) and install the SDK in it.
```sh
# install just the base SDK
pip install azureml-sdk

# clone the sample repoistory
git clone https://github.com/Azure/MachineLearningNotebooks.git

# below steps are optional
# install the base SDK and a Jupyter notebook server
pip install azureml-sdk[notebooks]

# install the data prep component
pip install azureml-dataprep

# install model explainability component
pip install azureml-sdk[explain]

# install automated ml components
pip install azureml-sdk[automl]

# install experimental features (not ready for production use)
pip install azureml-sdk[contrib]
```

### Full instructions
[Install the Azure Machine Learning SDK](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-create-workspace-with-python)

Please make sure you start with the [Configuration](configuration.ipynb) notebook to create and connect to a workspace.
Video walkthrough:

[![Get Started video](images/yt_cover.png)](https://youtu.be/VIsXeTuW3FU)

### Video walkthrough:
1. Setup a Jupyter Notebook server and [install the Azure Machine Learning SDK](https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-create-workspace-with-python)
1. Clone [this repository](https://aka.ms/aml-notebooks)
1. You may need to install other packages for specific notebook
- For example, to run the Azure Machine Learning Data Prep notebooks, install the extra dataprep SDK:
```bash
pip install azureml-dataprep
```

[![Get Started video](images/yt_cover.png)](https://youtu.be/VIsXeTuW3FU)
1. Start your notebook server
1. Follow the instructions in the [Configuration](configuration.ipynb) notebook to create and connect to a workspace
1. Open one of the sample notebooks
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ The [How to use Azure ML](./how-to-use-azureml) folder contains specific example
Visit following repos to see projects contributed by Azure ML users:

- [Fine tune natural language processing models using Azure Machine Learning service](https://github.com/Microsoft/AzureML-BERT)
- [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion)

- [Fashion MNIST with Azure ML SDK](https://github.com/amynic/azureml-sdk-fashion)
4 changes: 2 additions & 2 deletions configuration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"source": [
"import azureml.core\n",
"\n",
"print(\"This notebook was created using version 1.0.6 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.0.10 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down Expand Up @@ -373,4 +373,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
11 changes: 7 additions & 4 deletions how-to-use-azureml/automated-machine-learning/automl_setup.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@echo off
set conda_env_name=%1
set automl_env_file=%2
set options=%3
set PIP_NO_WARN_SCRIPT_LOCATION=0

IF "%conda_env_name%"=="" SET conda_env_name="azure_automl"
Expand Down Expand Up @@ -32,10 +33,12 @@ echo.
echo ***************************************
echo * AutoML setup completed successfully *
echo ***************************************
echo.
echo Starting jupyter notebook - please run the configuration notebook
echo.
jupyter notebook --log-level=50 --notebook-dir='..\..'
IF NOT "%options%"=="nolaunch" (
echo.
echo Starting jupyter notebook - please run the configuration notebook
echo.
jupyter notebook --log-level=50 --notebook-dir='..\..'
)

goto End

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

CONDA_ENV_NAME=$1
AUTOML_ENV_FILE=$2
OPTIONS=$3
PIP_NO_WARN_SCRIPT_LOCATION=0

if [ "$CONDA_ENV_NAME" == "" ]
Expand Down Expand Up @@ -34,10 +35,13 @@ else
echo "***************************************" &&
echo "* AutoML setup completed successfully *" &&
echo "***************************************" &&
echo "" &&
echo "Starting jupyter notebook - please run the configuration notebook" &&
echo "" &&
jupyter notebook --log-level=50 --notebook-dir '../..'
if [ "$OPTIONS" != "nolaunch" ]
then
echo "" &&
echo "Starting jupyter notebook - please run the configuration notebook" &&
echo "" &&
jupyter notebook --log-level=50 --notebook-dir '../..'
fi
fi

if [ $? -gt 0 ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

CONDA_ENV_NAME=$1
AUTOML_ENV_FILE=$2
OPTIONS=$3
PIP_NO_WARN_SCRIPT_LOCATION=0

if [ "$CONDA_ENV_NAME" == "" ]
Expand Down Expand Up @@ -36,10 +37,13 @@ else
echo "***************************************" &&
echo "* AutoML setup completed successfully *" &&
echo "***************************************" &&
echo "" &&
echo "Starting jupyter notebook - please run the configuration notebook" &&
echo "" &&
jupyter notebook --log-level=50 --notebook-dir '../..'
if [ "$OPTIONS" != "nolaunch" ]
then
echo "" &&
echo "Starting jupyter notebook - please run the configuration notebook" &&
echo "" &&
jupyter notebook --log-level=50 --notebook-dir '../..'
fi
fi

if [ $? -gt 0 ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,31 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup\n",
"\n",
"As part of the setup you have already created a <b>Workspace</b>. For AutoML you would need to create an <b>Experiment</b>. An <b>Experiment</b> is a named object in a <b>Workspace</b>, which is used to run experiments."
"## Setup\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To use the *forecasting* task in AutoML, you need to have the **azuremlftk** package installed in your environment. The following cell tests whether this package is installed locally and, if not, gives you instructions for installing it. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" import ftk\n",
" print('Using FTK version ' + ftk.__version__)\n",
"except ImportError:\n",
" print(\"Unable to import forecasting package. This notebook does not work without this package.\\n\"\n",
" + \"Please open a command prompt and run `pip install azuremlftk` to install the package. \\n\"\n",
" + \"Make sure you install the package into AutoML's Python environment.\\n\\n\"\n",
" + \"For instance, if AutoML is installed in a conda environment called `python36`, run:\\n\"\n",
" + \"> activate python36\\n> pip install azuremlftk\")"
]
},
{
Expand All @@ -71,6 +93,13 @@
"from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As part of the setup you have already created a <b>Workspace</b>. For AutoML you would need to create an <b>Experiment</b>. An <b>Experiment</b> is a named object in a <b>Workspace</b>, which is used to run experiments."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -368,7 +397,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.6.8"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,31 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup\n",
"\n",
"As part of the setup you have already created a <b>Workspace</b>. To run AutoML, you also need to create an <b>Experiment</b>. An Experiment is a named object in a Workspace which represents a predictive task, the output of which is a trained model and a set of evaluation metrics for the model. "
"## Setup"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To use the *forecasting* task in AutoML, you need to have the **azuremlftk** package installed in your environment. The following cell tests whether this package is installed locally and, if not, gives you instructions for installing it."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" import ftk\n",
" print('Using FTK version ' + ftk.__version__)\n",
"except ImportError:\n",
" print(\"Unable to import forecasting package. This notebook does not work without this package.\\n\"\n",
" + \"Please open a command prompt and run `pip install azuremlftk` to install the package. \\n\"\n",
" + \"Make sure you install the package into AutoML's Python environment.\\n\\n\"\n",
" + \"For instance, if AutoML is installed in a conda environment called `python36`, run:\\n\"\n",
" + \"> activate python36\\n> pip install azuremlftk\")"
]
},
{
Expand All @@ -71,6 +93,13 @@
"from sklearn.metrics import mean_absolute_error, mean_squared_error"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As part of the setup you have already created a <b>Workspace</b>. To run AutoML, you also need to create an <b>Experiment</b>. An Experiment is a named object in a Workspace which represents a predictive task, the output of which is a trained model and a set of evaluation metrics for the model. "
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -404,7 +433,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.6.8"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
" dsvm_compute = DsvmCompute.create(ws, name = dsvm_name, provisioning_configuration = dsvm_config)\n",
" dsvm_compute.wait_for_completion(show_output = True)\n",
" print(\"Waiting one minute for ssh to be accessible\")\n",
" time.sleep(60) # Wait for ssh to be accessible"
" time.sleep(90) # Wait for ssh to be accessible"
]
},
{
Expand Down
47 changes: 1 addition & 46 deletions how-to-use-azureml/azure-databricks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,7 @@ In this section, you will find sample notebooks on how to use Azure Machine Lear
- Every run (including the best run) is available as a pipeline, which you can tune further if needed.
- The model trained using Azure Databricks can be registered in Azure ML SDK workspace and then deployed to Azure managed compute (ACI or AKS) using the Azure Machine learning SDK.


**Create Azure Databricks Cluster:**

Select New Cluster and fill in following detail:
- Cluster name: _yourclustername_
- Databricks Runtime: Any **non ML** runtime (non ML 4.x, 5.x)
- Python version: **3**
- Workers: 2 or higher.

These settings are only for using Automated Machine Learning on Databricks.
- Max. number of **concurrent iterations** in Automated ML settings is **<=** to the number of **worker nodes** in your Databricks cluster.
- Worker node VM types: **Memory optimized VM** preferred.
- Uncheck _Enable Autoscaling_


It will take few minutes to create the cluster. Please ensure that the cluster state is running before proceeding further.

**Install Azure ML SDK without Automated ML capability on your Azure Databricks cluster**

- Select Import library

- Source: Upload Python Egg or PyPI

- PyPi Name: **azureml-sdk[databricks]**

**Install Azure ML with Automated ML SDK on your Azure Databricks cluster**

- Select Import library

- Source: Upload Python Egg or PyPI

- PyPi Name: **azureml-sdk[automl_databricks]**

**For installation with or without Automated ML**

- Click Install Library

- Do not select _Attach automatically to all clusters_. In case you selected this earlier, please go to your Home folder and deselect it.

- Select the check box _Attach_ next to your cluster name

(More details on how to attach and detach libs are here - [https://docs.databricks.com/user-guide/libraries.html#attach-a-library-to-a-cluster](https://docs.databricks.com/user-guide/libraries.html#attach-a-library-to-a-cluster) )

- Ensure that there are no errors until Status changes to _Attached_. It may take a couple of minutes.

**Note** - If you have an old SDK version, please deselect it from cluster’s installed libs > move to trash. Install the new SDK verdion and restart the cluster. If there is an issue after this, please detach and reattach your cluster.
Please follow our [Azure doc](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-configure-environment#azure-databricks) to install the sdk in your Azure Databricks cluster before trying any of the sample notebooks.

**Single file** -
The following archive contains all the sample notebooks. You can the run notebooks after importing [DBC](Databricks_AMLSDK_1-4_6.dbc) in your Databricks workspace instead of downloading individually.
Expand Down
Loading