Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to find the best way to visualize different distributions of accuracy. Accuracy here is a value in the interval [0,1], 0 meaning not accurate, 1 maximum accuracy.

I have different methods to compare, so I decided to use violin plots.

accuracy violin plots

Distributions are clustered near 1 but they have also a long tail (the first one is cut at 0.45).

How can I transform the data (e.g. in log-scale), in order to visualize better the differences between these plots? I want to focus in the interval [0.8, 1], but I want also to retain the long tails.

I do not want to use boxplots because in this case I saw that they do not show correctly the distributions (also because the lower quartile is already 1).

I add also the corresponding boxplot.



share|improve this question
If the first quartile (the lower quartile) is 1, then at least 75% of the distribution is at 1. In that case, no transformation will separate those values at 1, since they all have the same value - they'll always be transformed to the same thing. One thing you can do is look at the ecdf, perhaps. – Glen_b Jun 6 '14 at 9:34
You are right.. – fbrundu Jun 6 '14 at 9:36
If the lower quartile is already 1, then how it is readable from these plots that more than 75% of the values are at the right-hand edge? Either they lie or they are extraordinarily over-smoothed. – Nick Cox Jun 6 '14 at 13:36
@NickCox I used .. in fact, it is the first time I use violin plots - I do not exactly what to expect – fbrundu Jun 6 '14 at 17:04
I don't think the issue requires much expertise. You are telling us that >75% of the values are 1; I can't see that the violin plots tell us that, except that in 3 out of 4 instances there seems to be a minute fragment of a box. Conversely, the other instance seems to show more of a box. So I have no sense that the violin plots are showing the data faithfully. I've already suggested an alternative visualization. Another would be a quantile plot. – Nick Cox Jun 8 '14 at 8:12
up vote 6 down vote accepted

I have various takes on this.

  1. Don't expect too much from transformation. I read your results as saying that the upper quartile (**not* usually called the first quartile) is 1; hence >25% of the values tie at 1 and you have a spike in the distribution. Any one-to-one transformation will inevitably map a spike to a spike. There's no escape from that. (Also, see #4: I don't view this kind of visualization as a good idea in the presence of a spike, but there is some statistical taste and judgment in that view.) [EDIT: The original was edited to stating that it's the lower quartile that is 1. This intensifies #1 mightily.]

  2. Log transformation is definitely inappropriate as it will stretch your tail out further. Its inverse, say exp(), won't help much here as it is too near linear over this narrow range. Some high power, say fourth or higher, should make the distribution a little more symmetric, but can't solve #1.

  3. Why do you think you need a transformation? The results are as they are. Thinking you need a transformation often arises from a misconception that (e.g.) data must be nearly normal to do much with them, but that's an exaggeration. If you spell out analyses you plan downstream from this, there should be better advice forthcoming.

  4. I don't find the visualizations at all compelling, if only because it's hard to read off the precise differences between the distributions. I would try very fine binning, e.g. intervals of 0.01, and then look at histograms using a log frequency scale. In my view, an honest visualization would show spikes as such, not smooth over them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.