I have a simple KNN model and doing a cross_vaidation.
model = KNeighborsClassifier(n_neighbors = 2, weights='uniform')
cv = StratifiedKFold(n_splits = 5)
scores = cross_val_score(model, trainX, trainY, scoring=acc_score, cv = cv)
scores
the problem here is that for the scoring, the acc_score shows undefined when I ran it, and I couldn't figure out how come it is undefine here while I saw others using the same syntax without a probem.
the error I got:
NameError: name 'acc_score' is not defined
I think it might be an esay fix. the name might updated since the article I check out were wrote back in 2021. but I could find anything while I was searching.