Search code examples
azure-machine-learning-service

Converting rating column into boolean column with custom filter in Azure ML


I have a dataset in which the Rating column is an integer column with values ranging from 1 to 10.

I would like to convert that column into a simple boolean positive/negative categorical column, so that if the value is less than 6 it is a negative rating, and if it is greater or equal 6 it would become a positive rating.

I'm not sure how to do that.


Solution

  • Azure Machine Learning allows at least 3 options to do that:

    • Apply SQL Transformation select *,case when rating<6 then 0 else 1 end RatingB from t1
    • Execute Python Script return dataframe1.rating[dataframe1.rating < 6] = 0
    • Execute R Script dataset1$rating[dataset1$rating < 6] <- 0