Skip to content

Add docstrings to MCA class and fix outdated fit docstring#201

Merged
MaxHalford merged 1 commit intoMaxHalford:masterfrom
Pchambet:improve-mca-docstrings
Feb 27, 2026
Merged

Add docstrings to MCA class and fix outdated fit docstring#201
MaxHalford merged 1 commit intoMaxHalford:masterfrom
Pchambet:improve-mca-docstrings

Conversation

@Pchambet
Copy link
Contributor

Summary

  • Add a class-level docstring to MCA with numpydoc-style parameter descriptions for all 10 constructor arguments
  • Fix the MCA.fit docstring: it referenced a non-existent K parameter — replaced with an accurate description of the actual behavior (one-hot encoding + CA on the indicator matrix, K_ stored for corrections)
  • Add one-line docstrings to _prepare, row_coordinates, column_coordinates, row_cosine_similarities, and column_cosine_similarities

Motivation

While using prince.MCA in a project, I noticed the fit docstring mentions passing in K as a parameter, which doesn't match the current API (the number of variables is inferred from X.shape[1]). Took the opportunity to document the other methods as well.

No functional changes — docstrings only.

- Add class-level docstring to MCA with numpydoc-style parameter
  descriptions for all 10 constructor arguments
- Fix MCA.fit docstring: remove reference to non-existent K parameter,
  document the actual behavior (one-hot encoding + CA on indicator matrix)
- Add one-line docstrings to _prepare, row_coordinates,
  column_coordinates, row_cosine_similarities, column_cosine_similarities
@MaxHalford
Copy link
Owner

Thank you so much!

@MaxHalford MaxHalford merged commit a9f7094 into MaxHalford:master Feb 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants