scikit-learn
-
Cross validation에서 ROC AUC 구하기라이브러리/Scikit-learn 2021. 2. 14. 20:44
StratifiedKFold을 통해 cross validation할 데이터 생성 from sklearn.linear_model import LogisticRegression from sklearn.model_selection import cross_val_score, StratifiedKFold cv = StratifiedKFold(n_splits=5,shuffle=False) 각 cv별 fpr(False Positive Rate), tpr(True Positive Rate) 및 auc(Area under the ROC Curve) 계산 및 평균 계산 logit = LogisticRegression(fit_intercept=True) tprs = [] aucs = [] mean_fpr_lr = np.li..