Build custom models with Azure Machine Learning Designer

Posted on 20-10-2020 , by: admin , in , 0 Comments

Machine learning is an important part of modern application development, replacing much of what used to be done using a complex series of rules engines, and expanding coverage to a much wider set of problems. Services like Azure’s Cognitive Services provide prebuilt, pretrained models that support many common use cases, but many more need custom model development.

Going custom with ML

How do we go about building custom machine learning models? You can start at one end using statistical analysis languages like R to build and validate models, where you’ve already got a feel for the underlying structure of your data, or you can work with the linear algebra features of Python’s Anaconda suite. Similarly, tools such as PyTorch and TensorFlow can help construct more complex models, taking advantage of neural nets and deep learning while still integrating with familiar languages and platforms.

That’s all good if you’ve got a team of data scientists and mathematicians able to build, test, and (most importantly) validate their models. With machine learning expertise hard to find, what’s needed are tools to help guide developers through the process of creating the models that businesses need. In practice, most machine learning models fall into two types: the first identifies similar data, the second identifies outlying data.

We might use the first type of app to identify specific items on a conveyor belt or have the second look for issues in data from a series of industrial sensors. Scenarios like these aren’t particularly complex, but they still require building a validated model, ensuring that it can identify what you’re looking for and find the signal in the data, not amplify assumptions or respond to noise.

Introducing Azure Machine Learning Designer

Azure provides various tools for this, alongside its prebuilt, pretrained, customizable models. One, Azure Machine Learning Designer, lets you work with your existing data with a set of visual design tools and drag-and-drop controls.

You don’t need to write code to build your model, though there’s the option to bring in custom R or Python where necessary. It’s a replacement for the original ML Studio tool, adding deeper integration into Azure’s machine learning SDKs and with support for more than CPU-based models, offering GPU-powered machine learning and automated model training and tuning.

To get started with Azure Machine Learning Designer open the Azure Machine Learning site and log in with an Azure account. Begin by connecting to a subscription and creating a workspace for your models. The setup wizard asks you to specify whether the resulting models have a public or private end point and whether you’re going to be working with sensitive data before choosing how keys are managed. Sensitive data will be processed in what Azure defines as a “high business impact workspace,” which reduces the amount of diagnostic data collected by Microsoft and adds extra levels of encryption.

Configuring a machine learning workspace

Once you’ve walked through the wizard, Azure checks your settings before creating your ML workspace. Usefully it offers you an ARM template so you can automate the creation process in future, providing a framework for scripts that business analysts can use from an internal portal to reduce the load on your Azure administrators. Deploying the resources needed to create a workspace can take time, so be prepared to wait a while before you can start building any models.

Your workspace contains tools for developing and managing machine learning models, from design and training to managing compute and storage. It also helps you label existing data, increasing the value of your training data set. You’re likely to want to start with the three main options: working with the Azure ML Python SDK in a Jupyter-style notebook, using Azure ML’s automated training tools, or the low-code drag-and-drop Designer surface. 

2020 10 19 20 35 52 IDG

Azure Machine Learning Studio offers multiple ways to use your data to create ML models.

Using Azure ML Designer to create a model

The Designer is the quickest way to start with custom machine learning, as it gives you access to a set of prebuilt modules that can be chained together to make a machine learning API that’s ready for use in your code. Begin by creating a canvas for your ML pipeline, setting up the compute target for your pipeline. Compute targets can be set for the entire model, or for individual modules within the pipeline, allowing you to tune performance appropriately.

It’s best to think of your model’s compute resources as serverless compute, which scales up and down as necessary. When you’re not using it, it will scale down to zero and can take as long as five minutes to spin up again. This might impact application operations, so ensure that it’s available before running applications that depend on it. You will need to consider the resources needed to train a model when choosing a compute target. Complex models can take advantage of Azure’s GPU support, with support for most of Azure’s compute options (depending on your available quota).

Once you’ve set up your training compute resources, pick a training data set. This can be your own data or one of Microsoft’s samples. Custom data sets can be constructed from local files, from data already stored on Azure, from the Web, or from registered open data sets (which are often government information).

Using data in Azure ML Designer

Tools in the Designer allow you to explore the data sets you’re using, so you can be sure you have the right source for the model you’re trying to build. With a data source on the canvas, you can start dragging in modules and connecting them to process your training data; for example, removing columns that don’t contain enough data or cleaning up missing data. This drag-and-connect process is very like working with low-code tools, such as those in the Power Platform. What differs here is that you have the option of using your own modules.

Once data has been processed, you can start to choose the modules you want to train your model. Microsoft provides a set of common algorithms, as well as tools for splitting data sets for training and testing. The resulting models can be scored using another module once you run them through training. Scores are passed to an evaluation module so you can see how well your algorithm operated. You do need some statistical knowledge to interpret the results so you can understand the types of errors that are generated, though in practice the smaller the error value, the better. You don’t need to use the prepared algorithms, as you can bring in your own Python and R code.

A trained and tested model can be quickly converted into an inferencing pipeline, ready for use in your applications. This adds input and output REST API end points to your model, ready for use in your code. The resulting model is then deployed to an AKS inferencing cluster as a ready-to-use container.

Let Azure do it all for you: Automated Machine Learning

In many cases you don’t even need to do that much development. Microsoft recently released an Automated ML option, based on work done at Microsoft Research. Here you start with an Azure-accessible data set, which must be tabular data. It’s intended for three types of model: classification, regression, and forecasts. Once you provide data and choose a type of model, the tool will automatically generate a schema from the data that you can use to toggle specific data fields on and off, building an experiment that is then run to build and test a model.

Automated ML will create and rank several models, which you can investigate to determine which is the best for your problem. Once you’ve found the model you want, you can quickly add input and output stages and deploy it as a service, ready for use in tools like Power BI.

With machine learning an increasingly important predictive tool across many different types of business problem, Azure Machine Learning Designer can bring it a much wider audience. If you’ve got data, you can build both analytical and predictive models, with minimal data science expertise. With the new Automated ML service, it’s easy to go from data to service to no-code analytics.