Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Machine Learning Advanced Certification | Feb 13 - Mar 20 | Abhilash Chauhan | 2021

Hitesh H S

Well-Known Member
Staff member
Simplilearn Support
Hi Learners,

This thread is for you to discuss the queries and concepts related to the Machine learning Advanced certification course only.

Happy Learning !!

Regards,
Team Simplilearn
 
Hi Abhilash ,
I am performing Dimension reduction with PCA. Here i am trying to get number of components usinh GridsearchCV. However i am not able to get the same. Might be I am doing some wrong here. Could you please help me with the code. Below is my code

from sklearn.model_selection import GridSearchCV
grid = GridSearchCV( estimator= PCA() , param_grid= {'compo':[1,2,3,4,5]} , scoring= 'accuarcy',cv=10 , verbose= -1)

From above how can I get best n_components
 

Hitesh H S

Well-Known Member
Staff member
Simplilearn Support
Hi Abhilash ,
I am performing Dimension reduction with PCA. Here i am trying to get number of components usinh GridsearchCV. However i am not able to get the same. Might be I am doing some wrong here. Could you please help me with the code. Below is my code

from sklearn.model_selection import GridSearchCV
grid = GridSearchCV( estimator= PCA() , param_grid= {'compo':[1,2,3,4,5]} , scoring= 'accuarcy',cv=10 , verbose= -1)

From above how can I get best n_components
Hi Swayamjit,

Please refer to the below link for information about GridSearchcv

Happy Learning !!!
 
Top