/01
教学大纲Syllabus: Semester 1
https://andrewrkane.com/teaching/semester-1/syllabus
The course
Semester 1 of a four-semester data science course. It teaches Volume 1 of the Field Guide, Classical Data Science, in 15 weeks. The book is free to read online.
Each week: read the chapters and take each chapter's quiz before the session. The session covers the slides and a lab. Plan on 5 to 8 hours a week, including the session.
Prerequisites: basic Python (variables, loops, functions) and school algebra. Chapters 3 to 5 cover the maths the course needs.
Schedule
| Week | Chapters | Lab | Capstone |
|---|---|---|---|
| 1 | 1. History & Landscape 2. Business Problem Framing Course introduction | Frame three problems | |
| 2 | 3. Maths Foundations: Statistics, Probability & Linear Algebra | Penguins by the numbers | |
| 3 | 4. Maths Foundations: Calculus & Optimisation | Gradient descent by hand | |
| 4 | 5. Information Theory Basics | Which feature tells you most? | Capstone proposal: problem statement, dataset, and success criteria |
| 5 | 6. Python Data Science Ecosystem 7. Data Cleaning & Wrangling | Clean a real sensor log | |
| 6 | 8. SQL for Data Science | Retail analytics in SQL | |
| 7 | 9. Exploratory Data Analysis & Visualisation | Explore California housing | |
| 8 | 10. The Data Science Lifecycle 11. Supervised Learning: Overview of Approaches | A bank campaign, from charter to baseline | Capstone data report: cleaning, EDA, and a baseline |
| 9 | 12. Ensemble Methods | Forests and boosting | |
| 10 | 13. Cross-Validation & Model Selection Capstone modelling plan | How much can you trust one score? | |
| 11 | 14. Feature Engineering 15. Feature Selection & Dimensionality Reduction Research challenge starts | Features for bike demand | |
| 12 | 16. Model Evaluation Research challenge talks | Choose the metric, then the threshold | Capstone model report: validated models and the metric choice |
| 13 | 17. Hyperparameter Optimisation 18. Regularisation | Tune and regularise | |
| 14 | 19. Unsupervised Learning | Find the groups and the outliers | |
| 15 | 20. Time Series Analysis | Forecast, and beat the naive baseline | Capstone final: notebook, report, and a five-minute talk |
Assessment
- Chapter quizzes: knowledge checks. Pass mark 80% on each. Unlimited retakes.
- Exam: 40 questions across all chapters, after week 15. Pass mark 80%.
- Capstone project: the coursework. Four milestones, marked against a five-criterion rubric. To pass: meets the standard on every rubric criterion.
- Labs: weekly practice. Not graded.
To pass the semester, pass every quiz, the exam, and the capstone.
Learning outcomes
By the end of each week, you'll be able to do the following.
Week 1: History & Landscape, Business Problem Framing
- Place a technique in the history of the field: rules, statistics, machine learning, deep learning.
- Turn a vague business ask into an ML problem statement with a target, a prediction point, and a decision.
- Write down the cost of a false positive and a false negative, and use them to set a success criterion.
- Set up Python, Jupyter, and the companion notebooks, and run one end to end.
Week 2: Maths Foundations: Statistics, Probability & Linear Algebra
- Compute and interpret mean, variance, and correlation, and say when correlation misleads.
- Apply Bayes' rule to a base-rate problem and explain the result in words.
- Express a linear model as matrix operations and solve least squares with NumPy.
Week 3: Maths Foundations: Calculus & Optimisation
- Compute a gradient by hand and with code for a small function.
- Implement gradient descent and diagnose a learning rate that is too large or too small.
- Explain what momentum and Adam change about a gradient step.
Week 4: Information Theory Basics
- Compute entropy, cross-entropy, and KL divergence for small discrete distributions.
- Explain why log loss is cross-entropy, and why it punishes confident wrong answers.
- Compute the information gain of a split.
Week 5: Python Data Science Ecosystem, Data Cleaning & Wrangling
- Load, reshape, and summarise a dataset with pandas, using vectorised operations.
- Find and handle missing values, sentinel codes, duplicates, and wrong types, and justify each choice.
- Build a cleaning step that can run again on new data without hand edits.
Week 6: SQL for Data Science
- Write analytical SQL with joins, CTEs, and aggregations in DuckDB.
- Use window functions for running totals, ranks, and period-over-period change.
- Answer a cohort question in SQL and check the answer against pandas.
Week 7: Exploratory Data Analysis & Visualisation
- Run a structured EDA: shape, distributions, relationships, target, data quality.
- Spot a confounder or a Simpson-style reversal and show it with a grouped view.
- Choose a chart for a question and write the finding in one sentence.
Week 8: The Data Science Lifecycle, Supervised Learning: Overview of Approaches
- Name the stages of CRISP-DM and say what leaves each stage.
- Spot target leakage and train/serve skew in a feature list.
- Fit and compare linear, tree, and distance-based models against a baseline, inside a pipeline.
Week 9: Ensemble Methods
- Explain why bagging lowers variance and boosting lowers bias.
- Train and tune a random forest and a gradient-boosted model, and compare them with a single tree.
- Read feature importances and say what they do and do not show.
Week 10: Cross-Validation & Model Selection
- Explain why one train/test split gives a noisy, sometimes optimistic score.
- Choose k-fold, stratified, grouped or time-series CV for a dataset, and justify it.
- Run nested CV and explain why a tuned CV score is optimistic.
- Write a capstone modelling plan: the CV scheme, the main metric, and the baseline, each with a reason.
Week 11: Feature Engineering, Feature Selection & Dimensionality Reduction
- Engineer numeric, categorical, datetime, and cyclic features inside a leakage-safe pipeline.
- Target-encode a high-cardinality column without leaking the label.
- Compare filter, wrapper, and embedded selection, and PCA, on the same data.
Week 12: Model Evaluation
- Compute precision, recall, F1, ROC-AUC, and PR-AUC from predictions, and choose one from error costs.
- Pick a decision threshold from a cost matrix instead of using 0.5.
- Check calibration and fix it with Platt or isotonic scaling.
- Research an evaluation metric beyond the chapter, build it from scratch, and show an input where it misleads.
Week 13: Hyperparameter Optimisation, Regularisation
- Run grid, random, and Bayesian (Optuna) searches on the same budget and compare them.
- Read a learning curve and say whether a model needs more or less capacity.
- Fit Ridge, Lasso, and Elastic Net, choose alpha by CV, and explain why Lasso zeroes weights.
Week 14: Unsupervised Learning
- Cluster with k-means, Gaussian mixtures, DBSCAN, and hierarchical clustering, and say which assumptions each makes.
- Choose K with the elbow method and silhouette, and test whether the clusters are useful.
- Find anomalies with an isolation forest and report precision and recall where labels exist.
Week 15: Time Series Analysis
- Decompose a series into trend, seasonality, and residual, and test for stationarity.
- Fit exponential smoothing and ARIMA, and forecast with prediction intervals.
- Evaluate forecasts on a time-ordered split against a naive baseline, with MAE and MASE.
Materials
- Weekly plan, with chapters, quizzes, notebooks, slides, and labs: https://andrewrkane.com/teaching/semester-1
- Setup guide: https://andrewrkane.com/teaching/semester-1/setup
- Assessment: https://andrewrkane.com/teaching/semester-1/assessment
- Capstone project: https://andrewrkane.com/teaching/semester-1/capstone
- Worked example capstone: https://andrewrkane.com/teaching/semester-1/worked-example
- Research challenge: https://andrewrkane.com/teaching/semester-1/research-challenge
- Datasets: https://andrewrkane.com/teaching/semester-1/datasets
- Instructor guide: https://andrewrkane.com/teaching/semester-1/guide
- Exam: https://andrewrkane.com/teaching/semester-1/exam
- Extended reading: https://andrewrkane.com/teaching/semester-1/reading