Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 3: Classic Machine Learning in GeosciencesΒΆ

This chapter covers classic machine learning (CML) for geoscience: models that learn from feature tables rather than raw waveforms or images. Classic ML is fast to build, cheap to run, and easy to interrogate. That makes it the right place to learn the habits that carry over to deep learning: baselines, honest data splits, and evaluation that matches how a model will actually be used.

The arc of the chapterΒΆ

  1. Concepts (3.1) β€” the training-supervision taxonomy: supervised, unsupervised, semi-supervised, self-supervised, reinforcement, and active learning, and where each shows up in geoscience.
  2. Classification and regression (3.2) β€” the two supervised problem types, a first end-to-end workflow, and the train/validation/test split.
  3. Clustering (3.3) β€” unsupervised structure discovery: distance metrics, k-means from scratch, silhouette and elbow diagnostics, hierarchical clustering, and a volcanic-seismicity exercise.
  4. Binary classification (3.4) β€” event-vs-noise detection, classifier comparison, the metrics that matter when classes are imbalanced (precision, recall, PR curves vs ROC), and two knobs for treating imbalance (class weights, threshold moving).
  5. Multiclass classification (3.5) β€” four seismic source types, per-class confusion matrices, one-vs-rest ROC, and the class leaderboard exercise.
  6. Logistic regression from scratch (3.6) β€” the one lesson where the black box is opened: the loss function, gradient descent, automatic differentiation with PyTorch, and a calibration check β€” reliability diagrams and the Brier score β€” on the predicted probabilities.
  7. Trees, forests, and boosting (3.7) β€” decision trees, random forest regression, feature importance and its pitfalls (permutation importance, partial dependence, correlated features), and gradient boosting as the modern tabular default.
  8. Robust training (3.8) β€” cross-validation for correlated data: why random splits lie on autocorrelated series; time-aware, grouped (site, event), and leave-cluster-out spatial splits; StratifiedGroupKFold for small imbalanced case histories; persistence baselines and bootstrap confidence intervals on scores.
  9. Ensemble learning (3.9) β€” voting, bagging, boosting, and stacking, with ensemble vote spread as a first estimate of epistemic uncertainty and per-class recall in the model comparison.
  10. What became of AutoML (3.10) β€” a short history of automated model search, the pieces that survived (hyperparameter optimization with Optuna, strong gradient-boosting defaults), and a critical-evaluation exercise on AI-generated modeling code.

Dimensionality reduction (PCA, t-SNE) is covered in Chapter 2.12 and is used here as a preprocessing step, not re-taught.

The fair-evaluation threadΒΆ

A single discipline runs through every notebook in this chapter:

Lesson 3.5 puts this into practice with a class leaderboard: students train a classifier of their choice on a canonical split of a real seismic-source dataset, submit predictions by pull request, and are scored by continuous integration against both the public and the hidden test sets.

ToolsΒΆ

The chapter uses scikit-learn as the workhorse, lightgbm and scikit-learn’s histogram gradient boosting for boosted trees, optuna for hyperparameter search, and pytorch in 3.6 to introduce automatic differentiation. Course datasets come from the mlgeo_synth package (physically motivated synthetic generators), the course data repository, and a curated Zenodo archive of Pacific Northwest seismic events.

Learning outcomesΒΆ

By the end of this chapter, you will be able to:

AssignmentsΒΆ