From 6b8a6befde7498a8f181be7f19715d89a18774db Mon Sep 17 00:00:00 2001 From: Roope Astala Date: Mon, 25 Mar 2019 19:25:38 -0400 Subject: [PATCH] add automl files --- .../automated-machine-learning/automl_env.yml | 22 ++++++++ .../automl_env_mac.yml | 23 ++++++++ .../automl_setup.cmd | 51 +++++++++++++++++ .../automl_setup_linux.sh | 52 ++++++++++++++++++ .../automl_setup_mac.sh | 55 +++++++++++++++++++ 5 files changed, 203 insertions(+) create mode 100644 how-to-use-azureml/automated-machine-learning/automl_env.yml create mode 100644 how-to-use-azureml/automated-machine-learning/automl_env_mac.yml create mode 100644 how-to-use-azureml/automated-machine-learning/automl_setup.cmd create mode 100644 how-to-use-azureml/automated-machine-learning/automl_setup_linux.sh create mode 100644 how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh diff --git a/how-to-use-azureml/automated-machine-learning/automl_env.yml b/how-to-use-azureml/automated-machine-learning/automl_env.yml new file mode 100644 index 000000000..4b8390f83 --- /dev/null +++ b/how-to-use-azureml/automated-machine-learning/automl_env.yml @@ -0,0 +1,22 @@ +name: azure_automl +dependencies: + # The python interpreter version. + # Currently Azure ML only supports 3.5.2 and later. +- python>=3.5.2,<3.6.8 +- nb_conda +- matplotlib==2.1.0 +- numpy>=1.11.0,<1.15.0 +- cython +- urllib3<1.24 +- scipy>=1.0.0,<=1.1.0 +- scikit-learn>=0.18.0,<=0.19.1 +- pandas>=0.22.0,<0.23.0 +- tensorflow>=1.12.0 +- py-xgboost<=0.80 + +- pip: + # Required packages for AzureML execution, history, and data preparation. + - azureml-sdk[automl,explain] + - azureml-widgets + - pandas_ml + diff --git a/how-to-use-azureml/automated-machine-learning/automl_env_mac.yml b/how-to-use-azureml/automated-machine-learning/automl_env_mac.yml new file mode 100644 index 000000000..2acba36cc --- /dev/null +++ b/how-to-use-azureml/automated-machine-learning/automl_env_mac.yml @@ -0,0 +1,23 @@ +name: azure_automl +dependencies: + # The python interpreter version. + # Currently Azure ML only supports 3.5.2 and later. +- python>=3.5.2,<3.6.8 +- nb_conda +- matplotlib==2.1.0 +- numpy>=1.15.3 +- cython +- urllib3<1.24 +- scipy>=1.0.0,<=1.1.0 +- scikit-learn>=0.18.0,<=0.19.1 +- pandas>=0.22.0,<0.23.0 +- tensorflow>=1.12.0 +- py-xgboost<=0.80 + +- pip: + # Required packages for AzureML execution, history, and data preparation. + - azureml-sdk[automl,explain] + - azureml-widgets + - pandas_ml + + diff --git a/how-to-use-azureml/automated-machine-learning/automl_setup.cmd b/how-to-use-azureml/automated-machine-learning/automl_setup.cmd new file mode 100644 index 000000000..8913e6d51 --- /dev/null +++ b/how-to-use-azureml/automated-machine-learning/automl_setup.cmd @@ -0,0 +1,51 @@ +@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" +IF "%automl_env_file%"=="" SET automl_env_file="automl_env.yml" + +IF NOT EXIST %automl_env_file% GOTO YmlMissing + +call conda activate %conda_env_name% 2>nul: + +if not errorlevel 1 ( + echo Upgrading azureml-sdk[automl,notebooks,explain] in existing conda environment %conda_env_name% + call pip install --upgrade azureml-sdk[automl,notebooks,explain] + if errorlevel 1 goto ErrorExit +) else ( + call conda env create -f %automl_env_file% -n %conda_env_name% +) + +call conda activate %conda_env_name% 2>nul: +if errorlevel 1 goto ErrorExit + +call python -m ipykernel install --user --name %conda_env_name% --display-name "Python (%conda_env_name%)" + +REM azureml.widgets is now installed as part of the pip install under the conda env. +REM Removing the old user install so that the notebooks will use the latest widget. +call jupyter nbextension uninstall --user --py azureml.widgets + +echo. +echo. +echo *************************************** +echo * AutoML setup completed successfully * +echo *************************************** +IF NOT "%options%"=="nolaunch" ( + echo. + echo Starting jupyter notebook - please run the configuration notebook + echo. + jupyter notebook --log-level=50 --notebook-dir='..\..' +) + +goto End + +:YmlMissing +echo File %automl_env_file% not found. + +:ErrorExit +echo Install failed + +:End \ No newline at end of file diff --git a/how-to-use-azureml/automated-machine-learning/automl_setup_linux.sh b/how-to-use-azureml/automated-machine-learning/automl_setup_linux.sh new file mode 100644 index 000000000..cd760ab00 --- /dev/null +++ b/how-to-use-azureml/automated-machine-learning/automl_setup_linux.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +CONDA_ENV_NAME=$1 +AUTOML_ENV_FILE=$2 +OPTIONS=$3 +PIP_NO_WARN_SCRIPT_LOCATION=0 + +if [ "$CONDA_ENV_NAME" == "" ] +then + CONDA_ENV_NAME="azure_automl" +fi + +if [ "$AUTOML_ENV_FILE" == "" ] +then + AUTOML_ENV_FILE="automl_env.yml" +fi + +if [ ! -f $AUTOML_ENV_FILE ]; then + echo "File $AUTOML_ENV_FILE not found" + exit 1 +fi + +if source activate $CONDA_ENV_NAME 2> /dev/null +then + echo "Upgrading azureml-sdk[automl,notebooks,explain] in existing conda environment" $CONDA_ENV_NAME + pip install --upgrade azureml-sdk[automl,notebooks,explain] && + jupyter nbextension uninstall --user --py azureml.widgets +else + conda env create -f $AUTOML_ENV_FILE -n $CONDA_ENV_NAME && + source activate $CONDA_ENV_NAME && + python -m ipykernel install --user --name $CONDA_ENV_NAME --display-name "Python ($CONDA_ENV_NAME)" && + jupyter nbextension uninstall --user --py azureml.widgets && + echo "" && + echo "" && + echo "***************************************" && + echo "* AutoML setup completed successfully *" && + echo "***************************************" && + 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 ] +then + echo "Installation failed" +fi + + diff --git a/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh b/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh new file mode 100644 index 000000000..29fbd4c4d --- /dev/null +++ b/how-to-use-azureml/automated-machine-learning/automl_setup_mac.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +CONDA_ENV_NAME=$1 +AUTOML_ENV_FILE=$2 +OPTIONS=$3 +PIP_NO_WARN_SCRIPT_LOCATION=0 + +if [ "$CONDA_ENV_NAME" == "" ] +then + CONDA_ENV_NAME="azure_automl" +fi + +if [ "$AUTOML_ENV_FILE" == "" ] +then + AUTOML_ENV_FILE="automl_env_mac.yml" +fi + +if [ ! -f $AUTOML_ENV_FILE ]; then + echo "File $AUTOML_ENV_FILE not found" + exit 1 +fi + +if source activate $CONDA_ENV_NAME 2> /dev/null +then + echo "Upgrading azureml-sdk[automl,notebooks,explain] in existing conda environment" $CONDA_ENV_NAME + pip install --upgrade azureml-sdk[automl,notebooks,explain] && + jupyter nbextension uninstall --user --py azureml.widgets +else + conda env create -f $AUTOML_ENV_FILE -n $CONDA_ENV_NAME && + source activate $CONDA_ENV_NAME && + conda install lightgbm -c conda-forge -y && + python -m ipykernel install --user --name $CONDA_ENV_NAME --display-name "Python ($CONDA_ENV_NAME)" && + jupyter nbextension uninstall --user --py azureml.widgets && + pip install numpy==1.15.3 && + echo "" && + echo "" && + echo "***************************************" && + echo "* AutoML setup completed successfully *" && + echo "***************************************" && + 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 ] +then + echo "Installation failed" +fi + + +