- 1.1Why ML for Geoscience? Problem Framing and InferenceState the forward problem and the inverse problem for well logs, and say which one learning solves
- 1.2Workshop: Loading Ogbon-1 in PythonLoad the book's learning set from its CSV file in Python and read its 14 columns
- 1.3Chapter 1 QuizTest your understanding of Chapter 1: the forward and the inverse problem on the book's nine wells, the number to beat, and the learning set's file in Python
Applied Machine Learning for Geoscientists
Machine learning, taught on nine wells whose truth is known at every sample.
Machine learning taught on one synthetic learning set, the book's own nine wells, from the number to beat to autoencoders, every model scored with one well held out.
Training error keeps falling; test error turns back up
What you will learn
- One synthetic learning set from Chapter 1 to 16: Ogbon-1 and the field's eight appraisal wells
- Pay from the logs, scored leave one well out; a random split shown only to teach why it flatters
- Linear and logistic regression, kNN, naive Bayes, decision trees, random forests, PCA and t-SNE
- Neural networks, a 1-D CNN along depth and on the field's seismic line, an RNN and autoencoders
- Python workshops on the learning set's CSV that reproduce the numbers the figures print
Designed for
Geoscience students, petrophysicists, geophysicists and engineers who want machine learning on data they can check, and anyone who needs ML fluency in a subsurface context.
Read the full introduction
Sixteen chapters of machine learning, all taught on one learning set, the book's own and synthetic: Ogbon-1, the Petrophysics book's well, and the Ogbon field's eight appraisal wells, logged by the book's stated tool model, with the truth known at every half foot. The task is the petrophysicist's, pay from the logs, with lithology, zones and porosity where a chapter needs them. From the number to beat, through linear models, kNN, naive Bayes, trees and forests, features, validation, PCA and the data pipeline, to neural networks, CNNs, RNNs and autoencoders, every model is scored with one well held out, and every number is recomputed in your browser from the book's kernel or its precomputed tables.
Contents
16 chapters · 47 sections · 32 interactive figures- 2.1Distributions, Estimation, and Statistical InferenceCompute a sample's mean, median, standard deviation and skew from its central moments, and read a mean far from its median as a skew
- 2.2Workshop: Estimating Distributions from Geoscience DataLoad the learning set's file in Python, select the main sand of the nine wells, and compute its moments by hand
- 2.3Chapter 2 QuizTest your understanding of Chapter 2: a variable's moments and shape, the log transform, the normal quantile plot, the standard error and the bootstrap
- 3.1Gradient Descent and Sampling StrategiesWrite the gradient descent step for least squares and follow it by hand for its first steps
- 3.2Workshop: Implementing Gradient Descent from ScratchLoad the book's learning set in Python and write full-batch gradient descent from scratch for porosity on density
- 3.3Chapter 3 QuizTest your understanding of Chapter 3: the gradient descent step, the learning rate and the curvature, and stochastic and mini-batch descent with seeded orders
- 4.1Linear and Logistic Models for Continuous and Discrete TargetsFit a linear model to predict porosity from well logs by least squares, by the normal equations and by gradient descent, and read its error as an RMSE and an R-squared
- 4.2Workshop: Linear Regression on Well-Log DataLoad the book's learning set in Python and split it leave one well out
- 4.3Chapter 4 QuizTest your understanding of Chapter 4: linear and logistic regression, the threshold, the confusion matrix, the ROC curve and scores on wells held out
- 5.1K-Nearest Neighbors and Distance MetricsCall a sample by the vote of its k nearest neighbours, and explain why the logs are standardized before a distance is taken
- 5.2Workshop: Classifying Rock Types with KNNLoad the book's learning set in Python and read each column's unit
- 5.3Chapter 5 QuizTest your understanding of Chapter 5: k nearest neighbours on Ogbon-1's crossplot (Section 5.1) and choosing k on the nine wells with one well held out (Section 5.2)
- 6.1Naive Bayes and Probabilistic ClassificationState Bayes' rule for a classifier and say what the prior, the likelihood and the evidence each contribute
- 6.2Workshop: Naive Bayes on the Nine WellsScore Gaussian naive Bayes of pay in Python, one well held out at a time, and set it against logistic regression
- 6.3Chapter 6 QuizTest your understanding of Chapter 6: Bayes' rule, Gaussian naive Bayes and its priors, its sum term by term, and where its independence fails on the nine wells
- 7.1Decision Trees: Splits, Entropy, and PruningCompute the Gini impurity and the entropy of a node, and the weighted impurity a split leaves
- 7.2Workshop: A Decision Tree Classifier for LithologyGrow decision trees on the Ogbon field's nine wells and score each depth leave one well out, in Python and on the book's table
- 7.3Chapter 7 QuizTest what Chapter 7 computed: the impurity of a node, how a tree chooses its split, pruning by cost complexity on Ogbon-1, and a tree's depth chosen on the Ogbon field's nine wells, leave one well out
- 8.1Random Forests: Bagging and Out-of-Bag ValidationDraw a bootstrap of the rows and say why it leaves about a third of them out of each tree
- 8.2Workshop: A Random Forest for Pay on the Nine WellsGrow a random forest on eight of the nine wells at a time and score it on the ninth, in Python and on the book's table
- 8.3Chapter 8 QuizTest what Chapter 8 computed: a bootstrap and its out-of-bag rows, bagging's gain over one tree, what the out-of-bag score measures on wells, a forest held out one well at a time on the Ogbon field's nine wells, and two importances of its logs
- 9.1Feature Engineering and Encoding for Geoscience VariablesExplain why a feature's units are its weight in a distance, and standardize each feature on the training wells alone
- 9.2Workshop: Feature Engineering for Well LogsLoad the book's learning set in Python and fit a rule on Ogbon-1 alone
- 9.3Chapter 9 QuizTest your understanding of Chapter 9: units as weights, standardizing on the training wells, resistivity in log10, what a tree ignores, and depth as a feature that leaks
- 10.1Capacity, Underfitting, Overfitting, and the Bias-Variance Trade-offName a model's capacity (kNN's k, a tree's depth) and say which way it moves bias and variance
- 10.2Validation You Can Trust: Random, Blocked and Leave-One-Well-Out SplitsBuild three splits of the nine wells: random over the samples, blocked by depth, and leave one well out, and check that no well sits in two folds of the last
- 10.3Chapter 10 QuizTest your understanding of Chapter 10: capacity, bias and variance measured over many training sets, and which held-out split a score can be trusted from
- 11.1PCA, t-SNE, and UMAP for Geoscience DataSay what a principal component is: a weighted sum of the logs, along the direction they vary most together, at right angles to the others
- 11.2Workshop: A t-SNE Map of the Nine WellsDraw a seeded subsample of the nine wells, standardize its six logs and map it with t-SNE, in Python and on the book's table
- 11.3Chapter 11 QuizTest what Chapter 11 computed: the principal components of the six logs on the Ogbon field's nine wells, their eigenvalues and loadings, why the logs are scaled first, and what a t-SNE map of 600 samples keeps and loses against PCA
- 12.1The Pipeline of the Nine Wells: From the Rock to the Learning SetName the seven stages from the rock's truth to the learning set, and count each one's rows and size
- 12.2Workshop: The Pipeline's Last Steps in pandasCheck a delivery in pandas: its empty cells, its rows per well and its depth step
- 12.3Chapter 12 QuizTest your understanding of Chapter 12: the stages from the rock to the learning set, their sizes, depth alignment, QC and the treatments of a gap in pandas
- 13.1Single Neurons, Multi-Layer Networks, and BackpropagationWrite a neuron as a weighted sum through a squashing function, and say why one neuron draws a straight boundary as logistic regression does
- 13.2Workshop: A Small Network for Pay on the Nine WellsTrain a small network on eight of the nine wells at a time and score it on the ninth, in Python and on the book's table
- 13.3Chapter 13 QuizTest what Chapter 13 computed: a neuron's straight boundary and a hidden layer's bend on the neutron log and log10 RT, backpropagation against central differences, a network's loss from its first weights, and small and bigger networks held out one well at a time on the Ogbon field's nine wells
- 14.1CNNs Along Depth: Convolution and Learned FiltersCompute a 1-D convolution by direct sum and say how long its output is, "same" and "valid"
- 14.2Workshop: A CNN Segments the Field's Seismic LineBuild a synthetic seismic trace from a well's sonic and density: depth to time, impedance, reflection coefficients, a convolution with a Ricker
- 14.3Chapter 14 QuizTest what Chapter 14 computed: a convolution's output lengths, the logging tool's response as a convolution, what context buys a 1-D CNN on the nine wells, a synthetic seismic trace, and a segmentation scored on a stretch it never saw
- 15.1RNNs and Sequence Modeling for Time-Series Geoscience DataWrite the Elman cell's update and say what its hidden state carries from one sample to the next down a well
- 15.2Chapter 15 QuizTest what Chapter 15 computed: an Elman cell reading the Ogbon field's logs down depth, trained by backpropagation through time, scored one well at a time, and its memory across a bed boundary
- 16.1Auto-encoders for Compression and Anomaly DetectionDescribe an autoencoder: an encoder that squeezes each sample through a bottleneck of k numbers and a decoder that rebuilds it, trained only to copy its input
- 16.2Workshop: An Auto-encoder for Unsupervised Anomaly DetectionPlant the book's own log faults in the nine wells by a stated, seeded rule, in Python and as the book's kernel does
- 16.3Chapter 16 QuizTest what Chapter 16 computed: a linear autoencoder of Ogbon-1's six logs against PCA, the angle between their subspaces, a tanh autoencoder's bottleneck on wells it never saw, and an autoencoder's reconstruction error as a score for the book's planted log faults on the nine wells