Learning the dissimilarity between objects described by categorical attributes