Framework-agnostic toolkit with 29 CV methods, automatic data leakage detection,
clinical metrics, and regulatory compliance support.
Developed at SMAILE, Karolinska Institutet's core facility for AI.
Deep dive into how trustcv solves "data leakage" and why standard validation methods fail in clinical settings. (Generated with AI)
Choose the right validation strategy for your medical machine learning project
Hold-Out, K-Fold, Stratified, LOOCV, Bootstrap
9 methodsTime Series, Rolling, Expanding, Purged, CPCV
8 methodsGroup K-Fold, LOGO, LPGO, Hierarchical, Multi-level
8 methodsSpatial Block, Buffered, Spatiotemporal, Environmental
4 methodsAll validation strategies from the systematic review
29 methods totalScikit-learn, PyTorch, TensorFlow, MONAI
4+ frameworksComprehensive table with 29+ methods, medical applications, and implementation guidance
Automatic detection of data leakage, patient-level contamination, and temporal violations
Learn to select, justify, and document your cross-validation strategy to meet FDA and CE MDR requirements for AI/ML medical devices
Start LearningMethods designed for clinical data: patient grouping, disease prevalence, temporal patterns
Interactive tutorials with real medical datasets and Google Colab notebooks
Install from PyPI and validate your first model in minutes
# Install from PyPI
pip install trustcv
from trustcv import TrustCVValidator
from sklearn.ensemble import RandomForestClassifier
# Initialize with medical-specific settings
validator = TrustCVValidator(
method='group_kfold', # Patient-grouped cross-validation
n_splits=5,
check_leakage=True # Automatic data leakage detection
)
# Validate your model with patient grouping
results = validator.validate(
model=RandomForestClassifier(),
X=X_features,
y=y_labels,
groups=patient_ids # Ensure patient-level splits
)
# Get comprehensive results with clinical metrics
print(results.summary())
pip install trustcv[pytorch]
PyTorch support
pip install trustcv[tensorflow]
TensorFlow/Keras
pip install trustcv[monai]
Medical imaging
pip install trustcv[all]
All frameworks
Multiple ways to master medical cross-validation
Explore real medical scenarios through hands-on simulations
Test your understanding with our comprehensive CV quiz
Learn by coding with our Jupyter notebook tutorials