Closed somesh636 closed 4 years ago
There error means that X_train_pca
has either 0 or 1 dimensions, instead of 2, or there is only 1 column instead of 2. You can double-check by executing print(X_train_pca.shape)
before the for loop. The returned tuple should have at least 2 numbers, where the second number should be a 2.
This if you see that X_train_pca.shape
is not (100, 2)
, then there is a typo somewhere in your preceding code.
Thank you for your quick response. There was a typo in the code. This book is really good for understanding the Machine learning concepts.
glad to hear that you found and fixed it!
I am having an issue in executing the for generating the graph of the PCA in Chapter-5 of the book Python Machine Learning. I tried debugging but I am not able to understand what the problem in the code is.
Kindly provide support for this issue.