generated from LufsX/Experiment-kNN
This commit is contained in:
+1
-1
@@ -83,7 +83,7 @@ def load_dataset(directory):
|
|||||||
data = []
|
data = []
|
||||||
labels = []
|
labels = []
|
||||||
|
|
||||||
for filename in os.listdir(directory):
|
for filename in os.listdir("D:\\two"):
|
||||||
if filename.endswith(".txt"):
|
if filename.endswith(".txt"):
|
||||||
label = int(filename.split('_')[0]) # 假设文件名格式为 "label_xxx.txt"
|
label = int(filename.split('_')[0]) # 假设文件名格式为 "label_xxx.txt"
|
||||||
with open(os.path.join(directory, filename), 'r') as f:
|
with open(os.path.join(directory, filename), 'r') as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user