Categorical kernel functions for machine learning.