National Cheng Kung UniversityLAiMM LaboratoryMachine Learning
in Engineering Science

NCKU · Fall 2026 · Monday 14:00–17:00 · English-taught

Machine Learning
in Engineering Science

Understand the mechanism. Run the experiment. Reproduce the result. Explain what the evidence supports.

Instructor: Prof. Chi-Hua Jonny Yu
Focus: ML foundations, reproducibility, interpretability, and bounded agent workflows.

01 · LEARN

Work through definitions, mechanisms, equations, and numerical examples.

02 · REPRODUCE

Keep data identity, split boundaries, seeds, versions, and actual measured outputs.

03 · EXPLAIN

Connect results to assumptions; test interventions and state limits.

The complete semester

One connected learning path.

Monday meetings run from 14:00 to 17:00. ML foundations lead into sequence modeling, reliable evaluation, and agent workflows. The 19 October class follows the three-part sequence requested for this week.

Read · predict · run · modify · explain

Your weekly workbench.

Every teaching week has a complete worked practice notebook with Markdown explanations, expected checkpoints, troubleshooting, and an evidence export. The same .ipynb works in Colab and local Jupyter.

Weekly notebooks are in-class practice and optional extensions. Graded Homework occurs only at announced milestones. Midterm and final assessments each include a written examination and an oral examination.

W01 · 07 SepCourse introduction, data, and evidence

Describe a row, a unit, a target, and an evidence chain.

Week 01 guided practice

Describe a row, a unit, a target, and an evidence chain.

Open course-introduction slides

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W02 · 14 SepFeatures, targets, and leakage-safe splits

Build a preprocessing pipeline and inspect held-out classification errors.

Week 02 guided practice

Build a preprocessing pipeline and inspect held-out classification errors.

Download Week 02 slides

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W03 · 21 SepSupervised learning: regression and classification

Choose a baseline and distinguish continuous from categorical targets.

Week 03 guided practice

Choose a baseline and distinguish continuous from categorical targets.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W04 · 28 SepNo class — Teachers’ Day holiday

Follow the current semester calendar; no new in-class practice.

No new notebook is assigned on this calendar holiday. You may revisit the previous teaching module.

W05 · 05 OctEvaluation, validation, and overfitting

Explain precision, recall, specificity, thresholds, and validation. Homework milestone: ML Problem Brief.

Week 05 guided practice

Explain precision, recall, specificity, thresholds, and validation. Homework milestone: ML Problem Brief.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W06 · 12 OctUnsupervised learning and representation

Interpret PCA and clusters while separating geometry from physical meaning.

Week 06 guided practice

Interpret PCA and clusters while separating geometry from physical meaning.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W07 · 19 OctSequences → LSTM → Attention → Transformer

Trace LSTM memory, compute attention, and train/test a tiny causal Transformer across three one-hour modules.

H1 · 14:00–15:00 · 60 MIN · 30 SLIDES

Sequential Data and LSTM

From ordered windows and honest splits to RNN state, LSTM gates, trained forecasts, and baseline comparisons.

H2 · 15:00–16:00 · 60 MIN · 30 SLIDES

Why Attention, and How It Works

Resolve the context bottleneck; compute QK scores, softmax and weighted retrieval; inspect masks and interpretation limits.

H3 · 16:00–17:00 · 60 MIN · 30 SLIDES

From Attention to a Transformer

Add positions, heads, residuals and feed-forward layers; train a small decoder and test future-token isolation.

How the three hours work: about 90 minutes of explanation and worked reasoning, with 90 minutes of prediction, guided execution, experiments, and explain-back distributed across the three modules. Every slide has a two-minute facilitation cue; notebook operations provide the practice within that time.

Completion evidence: an LSTM baseline comparison, a verified attention calculation, a Transformer causality test, and one saved evidence record per notebook.

Download the full W07 LaTeX lecture chapter · Read the nine-page W07 PDF · Download all three slide decks and notebooks

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W08 · 26 OctNo class — observed Retrocession Day holiday

Consolidate the sequence notebooks; no new in-class practice.

No new notebook is assigned on this calendar holiday. You may revisit the previous teaching module.

W09 · 02 NovML reliability, shift, and error analysis

Stress-test model assumptions and report subgroup failures.

Week 09 guided practice

Stress-test model assumptions and report subgroup failures.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W10 · 09 NovReproducible ML workflow studio

Rebuild a baseline from frozen data and split IDs. Homework milestone: ML Workflow.

Week 10 guided practice

Rebuild a baseline from frozen data and split IDs. Homework milestone: ML Workflow.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W11 · 16 NovMidterm written and oral examinations

Explain project data, baseline, evaluation, limitations, and reproduction.

Week 11 guided practice

Explain project data, baseline, evaluation, limitations, and reproduction.

Optional exam rehearsal

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W12 · 23 NovLLMs, bounded agents, and vibe coding

Separate next-token generation from validated action execution.

Week 12 guided practice

Separate next-token generation from validated action execution.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W13 · 30 NovRetrieval, source evidence, and structured knowledge

Build a lexical retrieval baseline with source IDs and abstention.

Week 13 guided practice

Build a lexical retrieval baseline with source IDs and abstention.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W14 · 07 DecAgent testing, failure cases, and oversight

Enforce permissions, step budgets, and human review. Homework milestone: Final Agent Plan.

Week 14 guided practice

Enforce permissions, step budgets, and human review. Homework milestone: Final Agent Plan.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W15 · 14 DecAgent Studio I: build a bounded workflow

Produce traceable descriptive results with a validated input schema.

Week 15 guided practice

Produce traceable descriptive results with a validated input schema.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W16 · 21 DecAgent Studio II: evaluation and demo rehearsal

Compare candidates using reference cases and recorded failures. Homework milestone: Demo Readiness.

Week 16 guided practice

Compare candidates using reference cases and recorded failures. Homework milestone: Demo Readiness.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W17 · 28 DecProject integration and oral-exam preparation

Package data identity, code, result cards, limitations, and AI-use disclosure.

Week 17 guided practice

Package data identity, code, result cards, limitations, and AI-use disclosure.

Classroom exercise

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

W18 · 04 JanFinal written and oral examinations

Defend the final project with a reproducible evidence package.

Week 18 guided practice

Defend the final project with a reproducible evidence package.

Optional exam rehearsal

Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.

Homework · Forecasting and explanation

Build a stock forecasting system.

Compare persistence, Ridge regression, and LSTM using a reproducible chronological evaluation. Explain your system and evidence in a five-minute English video. This is a separately announced HW, not an extra weekly exercise.

Stock Market Prediction System

Includes the full English brief, grading rubric, data-leakage rules, submission checklist, and a guided Colab/Jupyter starter. Free CPU workflow; no paid API or deployment required. Due date: to be announced.

Supplementary explanations

Watch with a question in mind.

The lecture and notebooks are self-contained. These creator-hosted videos provide alternative explanations and optional deeper study; the three-hour class does not depend on watching full videos.

Textbook and primary sources

Read the mechanism in detail.

The Week 07 LaTeX chapter follows the same order as the three decks and notebooks: chronological windows, recurrent memory, attention arithmetic, and a causal Transformer.

Colab or local Jupyter

Start with a clean runtime.

  1. Click Open in Colab and save a copy to your own Drive.
  2. Use a CPU runtime, then run every cell from top to bottom.
  3. Read the Markdown explanation and predict the result before each operation.
  4. Download your evidence JSON and model artifacts before the runtime ends.

For local work: download the .ipynb, install Python and Jupyter, then run the setup cell. The setup installs missing free packages; all core data are generated locally or included with scikit-learn.

Course source and notebook repository ↗

No API keys, paid model calls, GPU allocation, or private datasets are required for the core exercises.