ARTIFICIALGATE · DR. BARAK OR

Transfer what you learned.

Thirteen independent practice challenges, aligned with the textbook. Write a prediction, test it and explain what would change your decision.

Use this companion after your first attempt

  1. Choose the chapter below and record your initial answer without a hint.
  2. Implement the task in a separate notebook. Keep source data, split identities, settings and seeds.
  3. Compare an expected invariant with your measured evidence. Test a deliberately wrong alternative.
  4. Explain one failure and the limits of your conclusion.
  5. If needed, open the first hint and record that assistance in your study log.

This learner edition contains task prompts and one conceptual hint per chapter. It deliberately excludes numeric answer checks, solution outlines and instructor answer keys. The original notebooks mention a fuller clinic; that solution-bearing edition is not part of this student pack. This page does not save answers, grade work or certify competence.

These are mathematical transfer exercises, not browser simulators. Some use explicitly constructed numerical fixtures to test an identity or implementation. A fixture result must not be reported as performance on real measured data.

Open the complete textbook PDF

CHAPTER 01

ML Problems, Data, and Generalization

Read the chapter · PDF page 16

Your task

Audit a delivery predictor when deployment changes from future orders at known restaurants to orders at unseen restaurants. Produce two prediction contracts and split plans using the same raw fields, including an actual dispatch timestamp created after order acceptance. Then use the declared target distribution with values zero, two and six and probabilities 0.2, 0.5 and 0.3 to compare constants two and 2.8 under squared and absolute loss. Finally, for three hypothetical fitted predictions one, two and four at a point whose true mean is two and fresh-noise variance is 0.5, reconcile direct average squared error with squared bias, prediction variance and noise. These are controlled arithmetic exercises, not delivery-performance claims.

Keep an evidence record

First hint — use only if needed

Separate what is available at prediction time from which entities may appear in evaluation. Neither check replaces the other.

Back to chapters

CHAPTER 02

Regression, Optimization, and Regularization

Read the chapter · PDF page 48

Your task

Reproduce the chapter's least-squares and Ridge computations after changing one feature's measurement unit by a factor of 1,000. Use a declared nonconstant two-feature training matrix and a held-out matrix. Compare unpenalized fitted predictions, raw-feature Ridge with the same numerical penalty, and Ridge after training-fitted standardization. Include a missing training value and a held-out sentinel value to audit train-only imputation. Keep the intercept unpenalized, translate the half-mean Ridge convention explicitly, and include a scalar gradient-descent boundary run at step size two. Explain which equalities follow mathematically and which comparisons must be measured.

Keep an evidence record

First hint — use only if needed

Track predictions and penalties separately: an inverse coefficient rescaling preserves their product with a feature, but not the squared coefficient penalty.

Back to chapters

CHAPTER 03

Classification and Imbalanced Data

Read the chapter · PDF page 87

Your task

Compare two deployment populations for one fixed binary decision rule whose true-positive rate is 0.75 and false-positive rate is 0.1 in both populations. Let positive prevalence be 0.02 in the first and 0.2 in the second. Use expected counts per 10,000 observations to compute confusion tables and precision. Separately, compare actions at true conditional probabilities 0.1, 0.2 and 0.8 when false positives cost one and false negatives cost five, with zero correct-decision costs and no shared capacity constraint. Finally, at a point with true positive probability 0.1, compute the population weighted-log-loss optimum for positive weight nine and negative weight one, then invert it. Do not treat the fixed-rule and conditional-probability calculations as measurements of a trained model.

Keep an evidence record

First hint — use only if needed

Begin with class totals, not the overall accuracy. Apply each rate only to the class on which it is conditioned.

Back to chapters

CHAPTER 04

Validation and Model Selection

Read the chapter · PDF page 133

Your task

Design nested validation for 48 observations from 12 devices, four rows per device, when the goal is new-device prediction. Use three device-disjoint outer folds and three device-disjoint inner folds with three candidate regularization values; assume each candidate is fitted once per fold and the winner is refitted once. Record original row and device identifiers at every fit and evaluation boundary. Then audit a deliberately invalid version that selects features using all 48 labels before splitting. Add a separate time-availability check for a three-step label horizon and prediction time 40, and a two-fold loss calculation with fold sizes two and eight. Explain why these arithmetic and boundary checks do not validate a confidence interval.

Keep an evidence record

First hint — use only if needed

Split device identifiers first and map them back to row identifiers. Audit the inner boundary relative to the current outer training set, not relative to the whole dataset.

Back to chapters

CHAPTER 05

Representations, PCA, and PLS

Read the chapter · PDF page 162

Your task

Construct a balanced Cartesian grid of u and v values -1 and 1, repeated ten times, with input columns x1 = 10u and x2 = 0.1v and target v. Compare raw rank-one PCR, raw rank-two PCR, and ridge; then repeat with six columns equal to u and two equal to v and include one-component PLS. Use a held-out replicate grid and keep every learned mean, scale, and direction inside the fitting split. For the algebra checks, normalize covariance by observation count (ddof=0); the usual sample covariance rescales the eigenvalues but not these ratios or directions. Finally add independent measurement noise under a fixed seed schedule. Report reconstruction and target error separately, without demanding the exact control's ranking in the noisy extension.

Keep an evidence record

First hint — use only if needed

Start by writing the two columns as scaled independent factors; compute each variance before calling a library.

Back to chapters

CHAPTER 06

Distance, Margins, and Kernels

Read the chapter · PDF page 194

Your task

Start with the two-point linear SVM example at inputs -1 and 1 and labels -1 and 1. Solve it for C = 1 and C = 0.1, reconstruct the coefficient, and identify free versus upper-bound support vectors. In the bounded case, derive all intercepts satisfying the KKT inequalities rather than averaging nonexistent free-point equations. Then reproduce the chapter's neighbor reversal under a tenfold second-coordinate rescaling. Finish with the declared nine-candidate, three-fold RBF experiment, logging preprocessing boundaries and kernel prediction cost.

Keep an evidence record

First hint — use only if needed

The equality constraint makes the two dual multipliers equal; substitute a single scalar into the dual objective.

Back to chapters

CHAPTER 07

Trees and Ensemble Learning

Read the chapter · PDF page 230

Your task

Implement a regression stump by enumerating thresholds between distinct ordered inputs. Use targets (1, 1, 5, 5), then perturb the second target and recompute every candidate gain. Independently reproduce the weighted Gini calculation. Build one additive boosting update from the chapter's three-point example and verify the old and new objectives. Finally draw an index-level plan for five-fold stacking with 600 observations and three base classifiers, showing every fit, meta-feature write, refit, and untouched final evaluation.

Keep an evidence record

First hint — use only if needed

For every threshold, recompute both child means before summing squared residuals; do not reuse the parent mean.

Back to chapters

CHAPTER 08

Clustering and Anomaly Detection

Read the chapter · PDF page 261

Your task

Reproduce one Lloyd iteration and both silhouettes for observations (0, 1, 8, 9). Then implement inclusive, self-counting DBSCAN neighborhoods for (0, 0.1, 0.2, 10, 10.1, 10.2, 5). Run a separate duplicate-row control with three observations all at zero. Finally compare the chapter's frozen-score threshold example with a batch-refitted clustering analysis. Preserve observation identities and identify which conclusions are geometry, stability evidence, or claims requiring external labels.

Keep an evidence record

First hint — use only if needed

Separate assignment error at the old centers from error after the mean update; they are different states.

Back to chapters

CHAPTER 09

Probability Calibration and Model Diagnosis

Read the chapter · PDF page 291

Your task

Enumerate a synthetic population with equal groups A and B, binary outcome rates 0.2 and 0.8, and constant versus group-aware forecasts. Compute conditional and aggregate Brier risks and residuals exactly, then change only the group mixture and, separately, only B's outcome rate. Reproduce the two-sensor permutation calculation with a frozen predictor. Finally compute split-conformal thresholds for nine fixed residuals at target coverages 90 and 95 percent. Explain which results are algebra, which depend on exchangeability, and which would require new labels in deployment.

Keep an evidence record

First hint — use only if needed

For each group, average squared loss over its two possible outcomes before applying the group weight.

Back to chapters

CHAPTER 10

Gaussian Processes and Experiment Selection

Read the chapter · PDF page 326

Your task

Select a first query from a two-candidate finite pool under a fixed GP. In the order reference, A, B, use latent covariance [[1, 0.05, 0.4], [0.05, 1, 0], [0.4, 0, 0.5]]. Candidate noise variances are 0.01 and 0.04. Before seeing either label, compare maximum latent variance with reduction of latent variance at the deployment reference. Then reveal a label and verify which posterior quantities depend on its value. Do not use the reference's label for selection.

Keep an evidence record

First hint — use only if needed

List the information visible before acquisition and distinguish latent variance from candidate measurement variance.

Back to chapters

CHAPTER 11

Neural Network

Read the chapter · PDF page 358

Your task

Extend the scalar tanh check to three examples, two input features, two hidden units, and one output. Use nonzero weights and biases, float64 arithmetic, and a per-example mean squared loss. Derive all nine parameter derivatives, compare both coordinate and directional finite differences, then deliberately introduce double averaging and detect it. No optimizer step is permitted during a derivative check.

Keep an evidence record

First hint — use only if needed

Write the shape of each cached forward quantity before multiplying derivatives.

Back to chapters

CHAPTER 12

Training and Debugging Neural Networks

Read the chapter · PDF page 396

Your task

Implement and test a checkpoint-selection state machine before using a neural network. Feed validation losses [0.42, 0.35, 0.34, 0.33, 0.34, 0.32], patience two, and required improvement 0.015. An improvement must be strictly greater than that threshold relative to the stored best checkpoint. Give every epoch a distinct mutable parameter state. Separately check the 64, 64, 22 batch-loss accounting and a saved preprocessing round trip. Do not use test performance to select a checkpoint.

Keep an evidence record

First hint — use only if needed

Write the stored best loss and patience counter beside each epoch before implementing the loop.

Back to chapters

CHAPTER 13

Text Classification and Embeddings

Read the chapter · PDF page 429

Your task

On an available, legally usable labeled text corpus, compare unigram and unigram-plus-bigram lexical pipelines with the same training, validation, and untouched test partitions. Select regularization using training-fold vocabulary fitting. Add representation unit tests for reordered tokens, out-of-vocabulary-only text, and repeated tokens. Report paired test gains and regressions alongside net accuracy and CPU prediction latency; this task requires no pretrained encoder download.

Keep an evidence record

First hint — use only if needed

Start with two documents containing the same tokens in different orders, then inspect each fitted representation before training.

Back to chapters

Modern Machine Learning · 2027 edition. Student companion prepared 7 October 2026. Visible practice tasks are not an unseen examination. Save your work in your own files.