python please help I m getting max X not defined

0 votes
from sklearn.model_selection import cross_val_score

max_k = 100

cv_scores = [ ]

for k in range(1,max_K):

knn = KNeighborsClassifier(n_neighbors = K)

scores = cross_val_score(knn,X_train,y_train.values.ravel(),cv = 5,scoring = "accuracy")

cv_scores.append(scores.mean())

im getting max_k is not defined. how do I fix it
Mar 22, 2021 in Python by anonymous

edited Mar 4, 2025 304 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP