],
"新步步惊心": [8, 34, 17, "爱情片"]}
return learning_dataset
def kNN(learning_dataset,dataPoint...v in learning_dataset.items():
#对距离进行平方和开根号
d=np.linalg.norm(np.array(v[:3])-np.array(dataPoint...片"]}
dataPoint=list(testData.values())[0][:3]
k=6
labels,result=kNN(learning_dataset...,dataPoint,k)
print(labels,result,sep='\n')