Q I am building a Random Forest model, and my categorical labels are strings (e.g., "Active" and "Inactive"). How can I convert "Active" to '1' and "Inactive" to '0' for use in a classification model?
A.
You can use the add column command to achieve this. Below is an example for a table called test_results with a column named Activity that contains the strings "Active" and "Inactive":
add column test_results function = "Activity=='Active'?1:0"
name="aaa"