<jupyter_start><jupyter_text>学習CSV作成<jupyter_code>import glob

import pandas as pd
images = []
labels = []

def make_csv(label):
    path = "../state-farm-distracted-driver-detection/imgs/train/" + label + "/*.jpg"
    for f in glob.glob(path):
        img = f.split("\\")[-1]
        images.append(img)
        labels.append(label[1:]) # c0->0

make_csv("c0")
make_csv("c1")
make_csv("c2")
make_csv("c3")
make_csv("c4")
make_csv("c5")
make_csv("c6")
make_csv("c7")
make_csv("c8")
make_csv("c9")
print(len(images))
print(len(labels))
train = pd.DataFrame(columns=["image", "label"])
train["image"] = images
train["label"] = labels
# csv書き出し
train.to_csv("../state-farm-distracted-driver-detection/train.csv", index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20372836218375498, 'fraction_numerical': 0.018641810918774968, 'mean_word_length': 5.064516129032258, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '504610', 'license': 'MIT', 'n_tokens_mistral': 313, 'n_tokens_neox': 305, 'n_words': 45, 'path': 'notebook/Make_Train.ipynb', 'repo_name': 'Beluuuuuuga/state-farm-distracted-driver-detection', 'size': '751'}