1. A computer implemented method comprising: receiving an indication of a metric to be optimized; presenting a user interface including a user interface feature to a group of users; collecting response data from the users experiencing the user interface; determining a plurality of attribute values for a user attribute of the group of users; for each attribute value of the plurality of attribute values, calculating a value of the metric for a subset of the group of users who have the user attribute of that attribute value, based on the response data; and determining at least one interface rule of applying the user interface feature depending on the user attribute using a machine learning model based on the values of the metric for the subsets of the group of users so that the metric is optimized.