Update dependencies, add PCA explained variance plotting functionalit…#127
Merged
idanmoradarthas merged 3 commits intoMay 21, 2026
Conversation
…y, and enhance documentation - Updated `pyarrow`, `kaleido`, `ruff`, and `build` dependencies in `pyproject.toml`. - Introduced `plot_pca_explained_variance` function to visualize cumulative explained variance of PCA components, aiding in dimensionality reduction analysis. - Added usage examples and detailed documentation for the new PCA plotting function in `README.md` and `visualization.rst`. - Updated `SKILL.md` to include the new PCA function with parameters and common usage scenarios. - Bumped version to 1.10.0rc13 to reflect these changes.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…A parameters - Updated the `plot_pca_explained_variance` function to allow passing additional keyword arguments (`pca_kwargs`) directly to the PCA initialization, enhancing flexibility in PCA configuration. - Modified the scaler parameter to default to `None`, using `StandardScaler` if no scaler is provided. - Enhanced documentation to reflect the new parameter options and usage examples in `SKILL.md`. - Added tests to validate the new functionality, ensuring correct handling of PCA parameters and Axes object passing.
idanmoradarthas
deleted the
85-add-plot_pca_explained_variance-function-to-preprocess-module
branch
May 21, 2026 03:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves #85. It enhances the
preprocessmodule by adding a new plotting function,plot_pca_explained_variance, which visualizes the cumulative explained variance ratio from Principal Component Analysis (PCA).This visualization will help users quickly determine how many principal components are required to capture a desired proportion of variance in their datasets.
Key Changes
plot_pca_explained_variancetods_utils/preprocess/visualization.py. It accepts numerical data, optionally scales it (defaulting toStandardScaler), and draws a line plot for cumulative variance with horizontal reference lines at 70% and 80%.tests/test_preprocess/test_plot_pca_explained_variance.pywith comprehensive unit tests for different parameters, handling invalid inputs, and rendering the plot. Usedsklearn.datasets.make_classificationto generate a realistic test dataset.pytest-mplbaseline images to test plot rendering.docs/source/preprocess/visualization.rstwith the function definition, code example, and the generated output image.README.mdcontaining a code snippet and the example image.skills/preprocess/SKILL.mdto document the new feature for agentic workflows.ruff.Type of change
Checklist:
pytest&pytest-mpl)ruff