CourseAI / ML Engineer: The Complete Course · Module 4: Deep Learning · part 29 of 93
Part 29 · Module 4: Deep Learning

Lab: A network against the trees, and ADR-002

72 min read·
Module 4 · Lab · About 60 minutes · Needs: lessons 1 to 4 of this module, and the Module 3 lab (or nothing: Step 1 rebuilds Modules 1 to 3)

What you are building

A network against the trees One fair comparison, two artefacts Active flow Background or async 1 Processing step number Lessons' parts Module 3 features MLP (lesson 1) train (lesson 2) seed_everything (lesson 4) This lab PyTorch TabularNet 5 seeds IntentTransformer lesson 3, retrained Kept ADR-002 trees win intent_classifier.pt for Module 12 tests/test_nn.py 3 tests 1 2 3
The lessons' parts (gold and blue) become one tabular network, trained with five seeds against v1, and the retrained intent transformer; the lab keeps ADR-002, the saved classifier and three tests (teal); circles give the order.

Adaeze's question for ADR-002 is plain: "Would a neural network beat the trees?" The lessons each trained a network their own way, with three different feature makers and three different loops, so their numbers cannot answer it. This lab builds one tabular network from the lessons' parts, trains it on exactly v1's weeks with five seeds, and puts it beside model v1 on the same holdout.

The lab keeps the lessons' nine files unchanged and adds kestrel/nn/tabular_net.py (the network behind Kestrel's interface, plus saving a model with what it needs), tests/test_nn.py, the intent classifier saved as artifacts/intent_classifier.pt for Module 12, and docs/adr/ADR-002-trees-or-network.md. No cell calls a hosted model.

Open a new Colab notebook, call it module-04-lab.ipynb, and run each cell in order. The CPU is enough; the whole lab took about half a minute on the course laptop.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan