AI+X 신림반 학생 커뮤니티

2025-12-23 ~ 2026-05-26

내 닉네임: 익명

2026-01-26 breast_cancer_data (유방암)데이터셋

작성자: 최윤성 | 2026-01-26 16:16 | 조회수 23
#임포트코드

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import mglearn
from imblearn.under_sampling import RandomUnderSampler
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report

'''

#breast_cancer_data
'''
1) 주어진 데이터를 로드해서 X / Y 를 나누고
2) 언더샘플링 하여 1:1을 맞추고
3) train_test_split를 통해 8:2, 랜덤 10으로 나눈 후 (결과비는 고정으로)
4) StandardScaler를 통해 표준화 하고 데이터 분포를 boxplot으로 확인
5) C값(0.001 ~ 1000)과 gamma값(0.0001 ~ 0.1)의 조합을 이중 for문으로 반복 학습하여 최적의 C와 감마, 정확도를 찾고
6) 각 조합에 따른 최종 예측 스코어를 찾고
7) Confusion matrix 로 표시하세요
'''



댓글 (0)

댓글 남기기

목록으로 돌아가기