Search code examples
azure-machine-learning-service

Equivalent of Subset in Azure machine learning studio


I have a dataset in azure machine learning (.csv), on the same dataset I have multiple models build, I want to subset data for each of the model based on a different column

Input:

ID col1 col2 col3
1  0    13   0
2  5    45   0
3  10   0    34
4  12   1    3

For the 1st model I want to retain all records where col1 not equal to None

ID col1 col2 col3
2  5    45   0
3  10   0    34
4  12   1    3

Similarly for model 2

ID col1 col2 col3
1  0    13   0
2  5    45   0
4  12   1    3

Hope it was clear

The equivalent in R would be

df[!df$col1 == "None",] 

Solution

  • You can use the "Execute R Script" module and just plug in your R code there.

    df <- maml.mapInputPort(1)
    df <- df[!df$col1 == "None",] 
    maml.mapOutputPort("df");