Skip to content

Tutorials: Beginner β†’ Advanced Learning Path

Step-by-step tutorials from first plots to reproducible pipelines, with proper validation and clear success criteria.


🎯 Learning Paths

Beginner (5–15 min each)

Get your first FoodSpec analysis running. No prior knowledge required.

Tutorial Time What You'll Learn
Load Spectra & Plot 5 min Load CSV data, create basic plots, understand spectral format
Baseline Correction & Smoothing 10 min Clean noisy spectra using ALS baseline and Savitzky–Golay smoothing
Simple Classification 15 min Classify oil types using PCA + logistic regression; visualize results

Intermediate (20–40 min each)

Solve real-world problems with proper validation and domain knowledge.

Tutorial Time What You'll Learn
Oil Authentication with Validation 25 min Cross-validation, confusion matrices, reproducible protocols
Domain Shift: Oil vs Chips 35 min Matrix effects, divergence analysis, marker stability across matrices
Stability Tracking 30 min Monitor degradation/aging using time series and QC metrics

Advanced (45–90 min each)

Build reproducible, production-ready pipelines with experiment tracking.

Tutorial Time What You'll Learn
Reproducible Pipelines with Configs 45 min YAML protocol design, version control, experiment tracking
Reference Workflow: Oil Authentication 90 min Canonical reproducible workflow; template for publications
HSI Surface Mapping 60 min Hyperspectral mapping and visualization

πŸ“š Supplementary Resources


πŸŽ“ Tutorial Template

Every tutorial in FoodSpec follows a consistent structure:

  1. Goal β€” What problem are we solving?
  2. Data β€” What data format and size do we need?
  3. Steps β€” High-level workflow overview
  4. Code β€” Copy-paste runnable Python/CLI examples
  5. Results β€” Expected outputs, plots, and metrics
  6. Interpretation β€” How to read the results
  7. Pitfalls β€” Common mistakes and how to avoid them
  8. Next Steps β€” What to learn next

πŸš€ Quick Navigation

By Use Case

By Skill Level

  • New to FoodSpec β†’ Start with Beginner
  • Comfortable with basics β†’ Try Intermediate
  • Publishing results β†’ Dive into Advanced

βœ… Prerequisites

Level 1

  • Python 3.10+ installed
  • FoodSpec installed: pip install foodspec
  • ~10 minutes of your time

Level 2

  • Complete Level 1 tutorials (or FoodSpec basics)
  • Understanding of cross-validation and classification metrics
  • Your own data (or use synthetic examples)

Level 3

  • Complete Level 2 tutorials (or publication experience)
  • Familiarity with YAML configuration
  • Git for version control (recommended)

πŸ”— Connection to Other Docs


πŸ’‘ Tips for Success

  1. Type the code yourself (don't copy-paste) to build muscle memory
  2. Experiment with parameters β€” Change smoothing window size, regularization, etc.
  3. Check the troubleshooting section before asking for help
  4. Link to tutorials when sharing work β€” Shows your methodology is reproducible
  5. Join the community β€” GitHub Discussions

πŸ“Š Progressive Difficulty

Level 1 (Beginner)       Level 2 (Applied)          Level 3 (Advanced)
β”œβ”€ Load spectra          β”œβ”€ Cross-validation        β”œβ”€ Experiment tracking
β”œβ”€ Plot basics           β”œβ”€ Domain shift             β”œβ”€ Reproducible configs
└─ Simple classifier     └─ Model comparison        └─ Publication pipeline
     ↓                          ↓                            ↓
  5-15 min             20-40 min                  45-90 min
  No assumptions        FoodSpec basics            Production-ready

🎯 Success Criteria

After each level, you should be able to:

Level 1 Complete? βœ“ - [ ] Load your own CSV spectra - [ ] Preprocess and visualize them - [ ] Train and evaluate a simple classifier

Level 2 Complete? βœ“ - [ ] Validate models using cross-validation - [ ] Interpret metrics and confusion matrices - [ ] Identify domain shift issues

Level 3 Complete? βœ“ - [ ] Define protocols in YAML - [ ] Track experiments and versions - [ ] Generate publication-ready reports


πŸ› Got Stuck?

Happy learning! πŸŽ“