[StratifiedKFold] Key Concepts and Descriptions
StratifiedKFold(...): 라벨 비율을 유지하며 환자들을 나누는 K-fold🧾 예시로 이해해보자df = pd.DataFrame({ "patient": ["P01", "P01", "P02", "P03", "P04", "P04", "P05"], "label": [1, 1, 0, 1, 0, 0, 1], "cell_type": ["T", "B", "T", "NK", "T", "B", "T"], ... }) 이 데이터는 총 7개의 세포가 있지만,실제로 환자는 다음처럼 5명만 존재:samples = df[["patient", "label"]].drop_duplicates()→ 이렇게 하면 환자별로 한 줄씩 남긴 표가 samplespatientlabelP011P020P031P040P051그 다음: St..
2025. 3. 27.