generated from LufsX/Experiment-kNN
This commit is contained in:
@@ -72,6 +72,9 @@ def classify_mahalanobis(input_vector, dataSet, labels, k=1):
|
||||
# 返回数量最多的类别标签
|
||||
return count.most_common(1)[0][0]
|
||||
|
||||
# 为评测系统创建别名
|
||||
classify = classify_mahalanobis
|
||||
|
||||
def load_dataset(directory):
|
||||
"""加载数据集中的图像,并将其转换为特征向量和标签。"""
|
||||
# 初始化特征数据列表和标签列表
|
||||
|
||||
Reference in New Issue
Block a user