1.1 Example: The Bike Sharing Dataset1.1.1 Loading the Data1.1.2 A Look Ahead1.2 Machine Learning and Prediction1.2.1 Predicting Past, Present, and Future1.2.2 Statistics vs. Machine Learning in Prediction1.3 Introducing the k-Nearest Neighbors Method1.3.1 Predicting Bike Ridership with k-NN1.4 Dummy Variables and Categorical Variables1.5 Analysis with qeKNN()1.5.1 Predicting Bike Ridership with qeKNN()1.6 The Regression Function: The Basis of ML1.7 The Bias-Variance Trade-off1.7.1 Analogy to Election Polls1.7.2 Back to ML1.8 Example: The mlb Dataset1.9 k-NN and Categorical Features1.10 Scaling1.11 Choosing Hyperparameters1.11.1 Predicting the Training Data1.12 Holdout Sets1.12.1 Loss Functions1.12.2 Holdout Sets in the qe*-Series1.12.3 Motivating Cross-Validation1.12.4 Hyperparameters, Dataset Size, and Number of Features1.13 Pitfall: p-Hacking and Hyperparameter Selection1.14 Pitfall: Long-Term Time Trends1.15 Pitfall: Dirty Data1.16 Pitfall: Missing Data1.17 Direct Access to the regtools k-NN Code1.18 Conclusions