Retrieve without the worked example: Create X with distance and y with duration.
Use the new retrieval population shown here.
Retrieve earlier concepts before combining them.
This practice: Retrieve earlier concepts before combining them. Next: Retrieval 2 · Foundations retrieval.
Given data · LINE12_REVIEW
12 observations. Deterministic teaching observations; values illustrate the concept rather than a real population claim. The dataframe df is supplied afresh for each Run.
| distance | duration |
|---|---|
| 0.840483 | 7.56117 |
| 2.11353 | 11.7333 |
| 1.94432 | 13.4821 |
| 3.04317 | 13.9131 |
| 4.04909 | 20.9425 |
| 4.71596 | 21.6036 |
| 5.07315 | 23.0636 |
| 5.85903 | 25.3493 |
| 6.81847 | 31.1129 |
| 8.16285 | 33.1802 |
| 8.76468 | 34.4287 |
| 9.76818 | 41.2942 |
Column meanings and units
Column names describe the supplied features and target. Keep the stated units and row identities when making comparisons.
Synthetic data are deliberately small and reproducible. Their patterns illustrate an idea; they are not evidence about a real population.
| Column | Stored type |
|---|---|
| distance | float64 |
| duration | float64 |
Supporting concepts: Measuring prediction error →
Remember the idea
Use the inputs and evidence to recover the method. Hints and explained solutions remain collapsed; exact phrasing is not graded.
Hint 1 — Think
Recall which object must remain a two-dimensional table even for one predictor.
Hint 2 — Tools
Dataframe column selection and aligned target Series.
Hint 3 — Approach
Separate the permitted predictor from its outcome without reordering rows.
Explained solution
X=df[['distance']]
y=df['duration']
The new population changes the values, but the X/y contract still separates inputs from the outcome to be learned.
Helpful prior knowledge: Measuring prediction error These links are guidance, not locks.
Sources and API context
Examples run with this Playground’s scikit-learn 1.4.2 / Pyodide 0.26.4 runtime.