public Double columnMean(int col) {
        if (!isContinuous(col)) {
            throw new MLException("Cannot calculate the mean of a non-continuous column");
        }
        double sum = 0.0;
        int count = 0;
        for (List<Double> row : data) {
            double val = row.get(col);
            if (val != UNKNOWN_VALUE) {
                sum += val;
                count++;
            }
        }
        return sum / count;
    }