@Override
    public String getSerializableForm(boolean includeConfidence) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < names.length; i++) {
            builder.append(names[i]);
            builder.append('=');
            builder.append(values[i]);
            if (includeConfidence && !Double.isNaN(variances[i])) {
                builder.append('\u00B1');
                builder.append(variances[i]);
            }
            builder.append(',');
        }
        builder.deleteCharAt(builder.length()-1);
        return builder.toString();
    }
@Test
    public void getsCorrectSerializableForm() {
        Regressor mr = new Regressor(
                new String[]{"a", "b", "c"},
                new double[]{1d, 2d, 3d}
        );
        assertEquals("a=1.0,b=2.0,c=3.0", mr.getSerializableForm(false));
        // Should be the same for includeConfidence either way, since we ignore NaN variances
        assertEquals("a=1.0,b=2.0,c=3.0", mr.getSerializableForm(true));

        Regressor scored = new Regressor(
                new String[]{"a", "b", "c"},
                new double[]{1d, 2d, 3d},
                new double[]{0d, 0d, 0.5}
        );
        assertEquals("a=1.0,b=2.0,c=3.0", scored.getSerializableForm(false));
        assertEquals("a=1.0\u00B10.0,b=2.0\u00B10.0,c=3.0\u00B10.5", scored.getSerializableForm(true));
    }