Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hello. i ' m not getting results in my grid. Its blanks.. what am I doing wrong? 4 7 ] Knn _ nod = KveighborsClassifier
hello. im not getting results in my grid. Its blanks.. what am I doing wrong?
Knnnod KveighborsClassifier
knnparans
nneighbors' : range
knngrid GridsearchCvknnmod, knnparams, cv njobs
knngrid.fit
printBest Paraneters: knngrid.bestparans
printBest CV score: knngrid.bestscore
Best Parameters: nneighbors':
Best CV score:
C Visualizing Results
Replace the blank in line of this cell with the name of your parameter dictionary from Replace the blank in line with the name of your
GridsearchCV object from B Then execute this cell to see how the CV scores varied with respect to the hyperparameter values. Use this
graph to determine if you should rerun the previous cell with a different range of hyperparameter values.
nneighbors knnparams nneighbors"
scores knngrid.cvresultsmeantestscore'
pltfigure figsizen
pltplotnneighbors, scores
pltxlabel nneighbors'
pltylabelcv score'
pltgrid
pltshow
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started