Calculating ideal types for data