Skip to content

FullStackWithLawrence/azureml-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Machine Learning - Automated ML Example

AzureML Python
Unit Tests Release Status Auto Assign License: AGPL v3 hack.d Lawrence McDaniel

Demonstrate basic usage of Azure Machine Learning's Automated ML service. Implements the following:

  • AzureAIMLWorkspace: Azure AI ML Studio workspace helper class. generates an authenticated instance of a workspace.
  • AzureAIMLAssetsDataset: Azure AI ML Studio data set. Provides helpers for managing ML Studio data sets, and for porting to/from kaggle data sets and local csv and Excel files.
  • AzureAIMLStudioComputeCluster: Azure AI ML Studio Compute - compute cluster object with helpers for instantitation.
  • AzureAIMLStudioAssetsBatchEndpoint: Azure AI ML Studio Assets - batch end point. Providers helpers for managing end points.
  • AzureAIMLStudioAuthoringAutomatedML: Azure AI ML Studio Authoring - Automated ML. Helper class for managing life cycle of 'automated ml' jobs.

There is also an example production deployment of a model created using AutomatedML. See important deployment details, here.

Note the following:

  1. Model training is a computationally intensive task and it is not free. You'll need a paid Azure Subscription. Expect to spend in the neighborhood of $0.10/per hour ($USD) when training models.

  2. This repo is currently based on Python3.9 even though this is several versions behind the latest stable version of Python. DO NOT ARBITRARILY UPGRADE TO LATER VERSIONS OF PYTHON. It will break. This repo is actively maintained. We monitor this. You have been warned.

  3. This project leverages Github Actions for automated unit tests, build, deploy, in addition to automating various administrative tasks including for example, automating updates to 3rd party package requirements. Most of these are visible from the Actions tab above.

Usage

python3 -m azure_ai.commands.help
python3 -m azure_ai.commands.workspace
python3 -m azure_ai.commands.compute_cluster cluster-name
python3 -m azure_ai.commands.dataset_from_file maths ~/Desktop/gh/fswl/azureml-example/azure_ai/tests/data/maths.csv
python3 -m azure_ai.commands.dataset_from_kaggle titanic heptapod/titanic

Setup

Works with Linux, Windows and macOS environments.

  1. Verify project requirements: Python 3.9, NPM Docker, and Docker Compose. Docker will need around 1 vCPU, 2Gib memory, and 30Gib of storage space.

  2. Run make and add your credentials to the newly created .env file in the root of the repo.

  3. Create an Azure account. See this summary for account configuration important details that you'll need to address in order for Azure AI AutomatedML batch jobs to run correctly: Azure Account Setup for AutoML

  4. Add your Azure config.json to the root of this project. See Azure ML Configuration Guide for detailed instructions on setting up an Azure Workspace and Subscription, and downloading your config.json file.

  5. Add your Kaggle Api key to .kaggle/kaggle.json, which you can generate from https://www.kaggle.com/settings/account.

  6. Install and configure Azure cli. On Mac brew install azure-cli. On Windows download from https://aka.ms/installazurecliwindows.

    • az login
    • az account list --output table
    • az account set --subscription "your-subscription-id-or-name"
  7. Initialize, build and run the application locally.

git clone https://github.com/FullStackWithLawrence/azureml-example.git
make                # scaffold a .env file in the root of the repo
                    #
                    # ****************************
                    # STOP HERE!
                    # ****************************
                    # Review your .env file located in the project root folder.
                    #
make init           # Initialize Python virtual environment used for code auto-completion and linting
make test           # Verify that your Python virtual environment was built correctly and that
                    # azureml.core finds your config.json file.
                    #
make docker-build   # Build and configure all docker containers
make docker-run     # Run docker container

Support

Please report bugs to the GitHub Issues Page for this project.

Developers

Please see:

You can also contact Lawrence McDaniel directly.

About

How to use the Microsoft Azure Machine Learning SDK for Python

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •