public Double mostCommonValue(int col) {
        boolean allUnknownValues = true;
        Map<Double, Integer> frequencies = new HashMap<Double, Integer>();
        for (List<Double> row : data) {
            double val = row.get(col);

            if (val != UNKNOWN_VALUE) {
                allUnknownValues = false;
                if (frequencies.containsKey(val)) {
                    frequencies.put(val, frequencies.get(val) + 1);
                } else {
                    frequencies.put(val, 1);
                }
            }
        }

        if (allUnknownValues) {
            return UNKNOWN_VALUE;
        }

        Set<Double> keySet = frequencies.keySet();
        Double mostCommonValue = UNKNOWN_VALUE;
        int highestFrequency = 0;

        for (Double key : keySet) {
            int val = frequencies.get(key);
            if (val > highestFrequency) {
                mostCommonValue = key;
                highestFrequency = val;
            }
        }
        return mostCommonValue;
    }