ワンクリックで
sklearn-eval-patterns
scikit-learn patterns for single-feature LR and RF evaluation with cross-validation and AUC scoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
scikit-learn patterns for single-feature LR and RF evaluation with cross-validation and AUC scoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Testing conventions, patterns, and best practices for kreview. MANDATORY reading before adding or modifying tests.
nbdev cell directives, module export conventions, editing workflow, and testing patterns for notebook-first development. MANDATORY reading before editing any kreview Python module.
5-tier ctDNA labeling hierarchy with IMPACT tissue rescue, CH hotspot filtering, configurable VAF/variant thresholds, and continuous VAF regression stats.
How to parse cBioPortal MAF, SV, CNA, and clinical files for the labeling pipeline.
Structured debugging framework for kreview data pipeline issues
DuckDB glob scan patterns, connection management, and performance for kreview
| name | sklearn-eval-patterns |
| description | scikit-learn patterns for single-feature LR and RF evaluation with cross-validation and AUC scoring. |
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import StratifiedKFold, cross_val_predict
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import StandardScaler
def single_feature_model(X, y, n_folds=5):
cv = StratifiedKFold(n_splits=n_folds, shuffle=True, random_state=42)
# LR (needs scaling)
X_scaled = StandardScaler().fit_transform(X)
lr_probs = cross_val_predict(
LogisticRegression(max_iter=1000, random_state=42),
X_scaled, y, cv=cv, method="predict_proba",
)[:, 1]
# RF (no scaling needed)
rf_probs = cross_val_predict(
RandomForestClassifier(
n_estimators=100, max_depth=5, min_samples_leaf=10,
class_weight="balanced", random_state=42,
),
X, y, cv=cv, method="predict_proba",
)[:, 1]
return {
"auc_lr": roc_auc_score(y, lr_probs),
"auc_rf": roc_auc_score(y, rf_probs),
}
class_weight="balanced" — groups are heavily imbalancedmax_depth=None for RF — will overfit on small strata