diff --git a/function.py b/function.py index 0accf61..63f15df 100644 --- a/function.py +++ b/function.py @@ -37,6 +37,13 @@ name = "吴俊煯" """ +def euclidean_distance(inX, dataSetRow): + """ + 计算欧氏距离 + """ + return np.sqrt(np.sum((inX - dataSetRow) ** 2)) + + # 这里写自己的代码实现 def classify0(inX, dataSet, labels,k=4): """