Skip to main content
← Lab

mcanegvar

confirmedupstream bugPython · princeSystems & data structuresJuly 25, 2026

the question

Does prince's Greenacre MCA correction return non-negative variance percentages at its default number of components?

what came out

prince/mca.py Greenacre branch builds the adjusted-inertia denominator from super().eigenvalues_, only the n_components computed eigenvalues, so at default n_components=2 the sum truncates negative and percentage_of_variance_ returns negative percentages (e.g. -1.402); the full spectrum makes them positive. 20/20 random datasets go negative.

method & receipts

  • Result: confirmed
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/mcanegvar