Skip to content

Fix pca tutorial from master - #353

Open
shajiaikram6-ai wants to merge 4 commits into
codebasics:masterfrom
shajiaikram6-ai:fix-pca-tutorial-from-master
Open

shajiaikram6-ai wants to merge 4 commits into
codebasics:masterfrom
shajiaikram6-ai:fix-pca-tutorial-from-master

Conversation

@shajiaikram6-ai

Copy link
Copy Markdown

Issues Identified and Improvements Made

While implementing the original notebook, i saw the following discrepancies and made changes accordingly.

  1. PCA on unscaled data: PCA was originally being applied on unscaled data, hence is corrected here

  2. Data leakage prevention: In the original notebook, the scaling and PCA were applied on the whole features, and train-test split was performed afterwards, resulting in data leakage issue from the test features for both PCA calculation and scaling. Its corrected here and StandardScaler and PCA are fitted only on the training data, and the learned transformations are applied to the test data.

These modifications aim to improve the correctness of the preprocessing workflow and prevent data leakage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant