0
votes

I have built an Microsoft Azure ML Studio workspace predictive web service, and have a scernario where I need to be able to run the service with different training datasets.

I know I can setup multiple web services via Azure ML, each with a different training set attached, but I am trying to find a way to do it all within the same workspace and passing a Web Input Parameter as the input value to choose which training set to use.

I have found this article, which describes almost my scenario. However, this article relies on the training dataset that is being pulled from the Load Trained Data module, as having a static endpoint (or blob storage location). I don't see any way to dynamically (or conditionally) change this location based on a Web Input Parameter.

Basically, does Azure ML support a "conditional training data" loading?

Or, might there be a way to combine training datasets, then filter based on the passed Web Input Parameter?

2

2 Answers

0
votes

This probably isn't exactly what you need, but hopefully, it helps you out.

To combine data sets, you can use the Join Data module.

To filter, that may be accomplished by executing a Python script. Here's an example.

Using the Adult Census Income Binary Classification dataset, on the age column, there's a minimum age of 17.

Before filtering

If I wanted to filter the data set by age, connect it to an Execute Python Script module and here's the filtering code with the pandas query method.

# The script MUST contain a function named azureml_main
# which is the entry point for this module.

import pandas as pd

def azureml_main(dataframe1 = None, dataframe2 = None):           
    # Return value must be of a sequence of pandas.DataFrame
    return dataframe1.query("age >= 25")

And looking at that output it filters out the data set where the minimum age is now 25.

After filter

0
votes

Sure, you can do that. What you would want is to use an Execute R Script or SQL Transformation module to determine, based on your input data, what model to use. Something like this:

enter image description here

Notice, your input data is cleaned/updated/feature engineered, then it's passed to two different SQL transforms which will tell it to go to one of two paths.

Each path has it's own training data.

Note: I am not exactly sure what your use case is, but if it were me, I would instead train two different models using the two different training data, then try to just use the models in my web service, not actually train on the web service as that would likely be quite slow.