Machine Learning Tools
19 tools for stroke classification, validation, and explainability
ML Capabilities
Classification: Random Forest, LDA, QDA, KNN, SVM | Validation: Temporal CV, Walk-Forward, K-Fold | Explainability: SHAP values, feature importance, decision boundaries
Classification (7 tools)
Train RF/DT/SVM/logistic model for FH/BH/Serve classification using Zepp sensor data
Train model using linked Apple Watch sessions with Zepp as ground truth
Linear or Quadratic Discriminant Analysis with boundary visualization
K-Nearest Neighbors with optimal k selection via cross-validation
Predict stroke types for Apple Watch session using trained model
Benchmark KNN, LDA, QDA, RF, DT and rank by performance
Recommend best classifier based on problem characteristics
Validation (5 tools)
Proper temporal cross-validation preventing future data leakage
Systematic CV with stratified/kfold/loo and multiple metrics
Sliding window validation mimicking production deployment
Time-aware folds with purge gap to prevent temporal leakage
Test if classifier degrades over time (monthly accuracy trend)
Explainability (4 tools)
SHAP values using TreeExplainer for feature contributions
SHAP waterfall for single swing showing push toward each class
Compare SHAP importance vs gain importance
SHAP interaction values between two sensor features
Tuning & Diagnostics (3 tools)
Grid search for optimal k, regularization, tree depth, etc.
Learning curves for bias/variance diagnosis
List all available ML tools and techniques by category
Example Workflow: Train and Explain Classifier
| Step | Query | Tool |
|---|---|---|
| 1 | "train stroke classifier with random forest" | train_swing_classifier |
| 2 | "compare classifiers performance" | compare_classifiers |
| 3 | "train with temporal cross validation" | train_swing_classifier_cv |
| 4 | "compute SHAP values" | compute_swing_shap_values |
| 5 | "explain prediction for swing 0" | explain_swing_prediction |
| 6 | "flag ambiguous swings for review" | flag_ambiguous_swings |