# How Machine Learning Works > Twelfth graders go beyond "AI is magic" to how machine learning actually works: collect example data, train a model to spot patterns, test it on new data… **Computer Science** | **Grade 12** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g12-cs-machine-learning.html* Twelfth graders go beyond "AI is magic" to how machine learning actually works: collect example data, train a model to spot patterns, test it on new data, use it to predict, then improve. They order the pipeline, then reason about where ML can go wrong. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Explain **machine learning**. - Order the **ML pipeline**. - See why **data quality** matters. - Spot where it fails. How does a machine actually "learn" from data? ## Order the ML Pipeline Project this and have students put the machine-learning steps in order. ## 55 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Not Magic How does a photo app learn to recognize your face? #### 👩‍🏫 Teacher Moves - Pose the question. - Share ideas. - Set the goal. #### 🎒 Student Actions - Think. - Share. - Get ready. ### Use — Machine Learning Students learn. #### 👩‍🏫 Teacher Moves - Send students to Order the ML Pipeline. - Order the steps. - Note it learns from data. #### 🎒 Student Actions - Order. - Say. - Note it. ### Modify — Trace It Students practice. #### 👩‍🏫 Teacher Moves - Name what training needs. - Say why we test on new data. - Explain "improve." #### 🎒 Student Actions - Name. - Say. - Explain. ### Create — Reason It Students apply. #### 👩‍🏫 Teacher Moves - Pick an ML use case. - Name what data it needs. - Spot a way bias could creep in. #### 🎒 Student Actions - Pick. - Name. - Spot. ### Reflect — Reflect Students close. #### 👩‍🏫 Teacher Moves - Say the first step. - Say why data quality matters. - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say it. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Describe how AI/ML artifacts are developed. Evaluate data used to train models. Evaluate algorithms and their outputs. Understand how automation and ML work. ## One lesson, every learner ### Multilingual Learners - Pipeline diagram. - Frame: "it learns by seeing ___." - Use the face example. ### Support & Access - Use 3 core steps. - Use a visual. - One concrete example. ### Stretch & Extend - Explain overfitting simply. - Find biased-data examples. - Compare ML to rule-based code. ### What to gather - 📽️Screen / board - 🤖ML pipeline cards - 💻Order the ML Pipeline - 📋Use-case sheet - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **machine learning**: learning patterns from data - **model**: what the ML system builds - **training data**: examples it learns from - **pattern**: a regularity in data - **prediction**: the model’s output - **test data**: new data to check it - **bias**: unfair skew from bad data - **accuracy**: how often it is right ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: how machine learning works. Have students pick an ML use case and spot where bias could creep in. A printable use-case sheet is in the CS library. ## Check your understanding **1. What does “machine learning” mean?** - how often it is right - new data to check it - learning patterns from data *(correct)* - what the ML system builds “machine learning” means: learning patterns from data **2. Which word means: “what the ML system builds”?** - model *(correct)* - machine learning - test data - training data “model” means: what the ML system builds **3. What does “training data” mean?** - what the ML system builds - unfair skew from bad data - examples it learns from *(correct)* - new data to check it “training data” means: examples it learns from **4. Which word means: “a regularity in data”?** - test data - training data - model - pattern *(correct)* “pattern” means: a regularity in data **5. What does “prediction” mean?** - the model’s output *(correct)* - new data to check it - learning patterns from data - how often it is right “prediction” means: the model’s output **6. Which word means: “new data to check it”?** - machine learning - model - test data *(correct)* - pattern “test data” means: new data to check it ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g12-cs-machine-learning.html All lessons: https://lessonplans.k12academics.com/