There are two different approaches to building chemical perception models depending on whether the input data is continuous or categorical. Both approaches require an objective to optimized as a function of the SMARTS hierarchy. Adding or removing SMARTS from the hierarchy will cause the objective to change, and we seek to minimize the objective function value. Below we describe the two different methods.