Week 01 · Page 2 of 4 · Directed Work (Travaux Dirigés)

Before any code is written, you must be able to look at a table of numbers and say, correctly, what kind of problem it is.

Directed Work Full Solutions Included Pencil and Paper

Attempt each problem yourself before expanding the solution. Solutions are hidden by default — click "Show solution" only after writing down your own answer, even if you are unsure of it.

1 Identifying the setting

For each of the following situations, state whether it is a supervised or unsupervised learning problem, and identify the feature(s) and the label (if any).

  1. You have 80 compounds with known, computed magnetic moments, and you want to predict the magnetic moment of a new compound from its composition.
  2. You have 200 candidate crystal structures from a structure-search algorithm, none of which have been evaluated by DFT yet, and you want to know if they fall into a small number of structural families.
  3. You have measured optical absorption spectra for 30 thin films along with their known band gaps, and you want to predict band gap from the spectrum shape.
Show solution

(a) Supervised. Feature: composition (and whatever descriptors are derived from it). Label: magnetic moment, which is known for all 80 compounds. The goal — predicting a label for a new, unlabeled compound — is the defining signature of supervised learning.

(b) Unsupervised. Feature: whatever structural descriptors you compute for each of the 200 structures. There is no label, since none have been evaluated by DFT. "Falling into structural families" is exactly the kind of structure-discovery goal unsupervised learning targets — this is a clustering problem, formalized in Week 5.

(c) Supervised. Feature: the spectrum shape (in practice, a vector of absorption values at many wavelengths). Label: the known band gap for each of the 30 films. Note that the feature here is more complex than a single number — it is itself a small dataset (a curve) for each example, which is a preview of why later weeks need richer feature representations than a handful of scalars.

2 Fitting a linear model by hand

You are given the following dataset relating a single feature (unit cell volume per atom, in ų) to a label (bulk modulus, in GPa) for five hypothetical compounds:

CompoundVolume/atom (ų)Bulk modulus (GPa)
110220
212190
314160
416130
518100

(a) Propose a simple linear model relating bulk modulus to volume/atom. (b) Estimate its two parameters using the first and last data points. (c) Use your fitted model to predict the bulk modulus for a sixth compound with volume/atom = 20 ų. (d) Is your prediction for part (c) likely to be reliable? Why or why not?

Show solution

(a) A reasonable model is K = a · V + b, where K is bulk modulus and V is volume/atom.

(b) Using compounds 1 and 5: slope a = (100 − 220)/(18 − 10) = −120/8 = −15. Intercept from compound 1: 220 = (−15)(10) + b, so b = 370. Fitted model: K = −15V + 370.

(c) At V = 20: K = (−15)(20) + 370 = 70 GPa.

(d) This prediction is an extrapolation — V = 20 lies outside the range of training volumes (10 to 18). Linear models can extrapolate arbitrarily far numerically, but there is no physical guarantee the true relationship stays linear beyond the data you trained on. This is a first, hand-worked encounter with a problem that will reappear constantly: a model is only trustworthy within, or close to, the range of data it was trained on.

3 Grouping by eye

Eight candidate compounds have been described by two features: electronegativity difference (Δχ) and radius ratio (rcation/ranion).

CompoundΔχRadius ratio
M10.40.55
M20.50.58
M30.450.52
M41.80.30
M51.90.28
M61.70.32
M71.00.45
M81.050.43

(a) Sketch these eight points on a Δχ vs. radius-ratio axis (paper, by hand). (b) How many natural groups do you see, and which compounds belong to each? (c) Is this a supervised or unsupervised task, and why?

Show solution

(a)–(b) Three groups are visible: {M1, M2, M3} at low Δχ and high radius ratio; {M7, M8} at intermediate Δχ and intermediate radius ratio; {M4, M5, M6} at high Δχ and low radius ratio.

(c) Unsupervised. No label (such as a known bonding type or crystal structure) was given — only two features per compound. The three visible groups are a hypothesis about structure in the data, consistent with the chemical intuition that Δχ and radius ratio together influence bonding character, but nothing here has confirmed that interpretation; confirming it would require checking the groups against an independent, known property.

Before moving on

If you answered all three problems correctly without checking the solutions first, you are ready for the Practical Work page. If you needed to check a solution to understand why, re-read the corresponding section of the Lesson page before continuing — the vocabulary, not the arithmetic, is what Week 2 depends on.

← Lesson Directed Work · Page 2 of 4 Practical Work →