PCA - Colab
PCA - Colab
ipynb - Colab
# Features (all columns except the last) and Labels (last column)
X = data.iloc[:, :-1].values # Features
y = data.iloc[:, -1].values # Labels
https://colab.research.google.com/drive/1_KBRgYJlwVjZQJe-P3HdUflPhQPGtAG4#scrollTo=T_ebqXyuWO1Z&printMode=true 1/2
12/14/24, 9:13 PM Untitled3.ipynb - Colab
File found, loading the dataset.
First few rows of the dataset:
Time V1 V2 V3 V4 V5 V6 V7 \
0 0 -1.359807 -0.072781 2.536347 1.378155 -0.338321 0.462388 0.239599
1 0 1.191857 0.266151 0.166480 0.448154 0.060018 -0.082361 -0.078803
2 1 -1.358354 -1.340163 1.773209 0.379780 -0.503198 1.800499 0.791461
3 1 -0.966272 -0.185226 1.792993 -0.863291 -0.010309 1.247203 0.237609
4 2 -1.158233 0.877737 1.548718 0.403034 -0.407193 0.095921 0.592941
[5 rows x 31 columns]
PCA Explained Variance Ratio: [9.99761791e-01 2.38122500e-04]
Accuracy of Logistic Regression: 0.9971666666666666
Interpretation of Accuracy: The model has high accuracy and is likely performing well on the test data.
https://colab.research.google.com/drive/1_KBRgYJlwVjZQJe-P3HdUflPhQPGtAG4#scrollTo=T_ebqXyuWO1Z&printMode=true 2/2