{"id":5200,"date":"2024-04-21T13:36:52","date_gmt":"2024-04-21T13:36:52","guid":{"rendered":"https:\/\/dalelane.co.uk\/blog\/?p=5200"},"modified":"2026-04-02T17:26:37","modified_gmt":"2026-04-02T17:26:37","slug":"hoops-a-machine-learning-for-kids-worksheet","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=5200","title":{"rendered":"Hoops (a Machine Learning for Kids worksheet)"},"content":{"rendered":"<p><a href=\"https:\/\/machinelearningforkids.co.uk\/\">Machine Learning for Kids<\/a> is intended to be an open creative sandbox to let students invent their own AI-powered projects. But in order to enable that, I create more prescriptive <a href=\"https:\/\/machinelearningforkids.co.uk\/worksheets\">project worksheets<\/a> to inspire and show what is possible. <\/p>\n<p>I&#8217;ve just written <a href=\"https:\/\/github.com\/IBM\/taxinomitis-docs\/raw\/master\/project-worksheets\/pdf\/worksheet-hoops.pdf\">another worksheet based around regression models<\/a> &#8211; a model type that I <a href=\"https:\/\/dalelane.co.uk\/blog\/?p=5060\">added support for in February<\/a>. <\/p>\n<p>This project is based on shooting basketballs.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.dalelane.co.uk\/2024-04-21-hoops\/hoops-game.png\" style=\"width: 100%; max-width: 900px;\"\/><\/p>\n<p><!--more-->You could try to calculate the power and direction to use to fire the ball. In this project, students train a regression model to predict the values to use, based on the starting location of the ball.<\/p>\n<p>To do this, students play the game for themselves. It&#8217;s harder than it looks&#8230; but you can reset and tweak the power and direction values until you get it in the hoop. <\/p>\n<p><iframe loading=\"lazy\" width=\"450\" height=\"340\" src=\"https:\/\/www.youtube.com\/embed\/OrKoAP345oc?si=x3uNN_YTOriqrgyq\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen style=\"border: thin black solid\"><\/iframe><br \/>\n<small><a href=\"https:\/\/youtu.be\/OrKoAP345oc\">youtu.be\/OrKoAP345oc<\/a><\/small><\/p>\n<p>Every time you score, these values are added into the training data for your project:<\/p>\n<ul>\n<li>starting location of the ball, as x,y coordinates<\/li>\n<li>power value used to launch the ball<\/li>\n<li>direction the ball was fired in<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/images.dalelane.co.uk\/2024-04-21-hoops\/hoops-training.png\" style=\"border: thin black solid; width: 100%; max-width: 900px;\"\/><\/p>\n<p>These examples can be used to train a custom machine learning model that can predict the power and direction to use. <\/p>\n<p>This model can be added to the Scratch project. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.dalelane.co.uk\/2024-04-21-hoops\/hoops.png\" style=\"border: thin black solid; width: 100%; max-width: 900px;\"\/><\/p>\n<p>Even with a small number of training examples, the model gets surprisingly good at scoring hoops.<\/p>\n<p><iframe loading=\"lazy\" width=\"450\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/KS89KD91Vzs?si=M8HxeYLnEv9euzzz\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen style=\"border: thin black solid\"><\/iframe><br \/>\n<small><a href=\"https:\/\/youtu.be\/KS89KD91Vzs\">youtu.be\/KS89KD91Vzs<\/a><\/small><\/p>\n<p>I&#8217;ve written up step-by-step instructions for how to create this and added it to <a href=\"https:\/\/machinelearningforkids.co.uk\/worksheets\">machinelearningforkids.co.uk\/worksheets<\/a>.<\/p>\n<h3>What is different about this project?<\/h3>\n<p>My goal for this project was to show an example of a regression model with <strong>more than one output variable<\/strong>. <\/p>\n<p>Until now, the other regression projects have all predicted a single value, so I wanted an example project that shows you can have multiple outputs. It&#8217;s a very neat difference to the classification models that are behind most of the project worksheets. <\/p>\n<h3>But maybe it&#8217;s not that different<\/h3>\n<p>I&#8217;m struggling to come up with something original here!<\/p>\n<p>The regression worksheets I&#8217;ve got so far are:<\/p>\n<h4>Catch a ball, by predicting where it will land<\/h4>\n<p><iframe loading=\"lazy\" width=\"450\" height=\"250\" src=\"https:\/\/www.youtube.com\/embed\/SiUURaOQcdk?si=v1nqVuAQicmF3Ni8&amp;start=472\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen style=\"border: thin black solid\"><\/iframe><\/p>\n<h4>Shoot the bug, by predicting where the ball will go<\/h4>\n<p><iframe loading=\"lazy\" width=\"450\" height=\"250\" style=\"border: thin black solid;\"  src=\"https:\/\/www.youtube.com\/embed\/61ErSoKc2kM?si=kBJ3cU1KLfKYfF41&amp;start=50\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>If I was feeling defensive, I&#8217;d argue that they are all using machine learning in a different way. For example, the first project is based predicting a parabola that takes bounces off the wall into account, while the second is a straight shot at a moving target. But. They&#8217;re still all based around projectiles. <\/p>\n<p>I need a new idea for a regression project that <strong>isn&#8217;t<\/strong> based on a moving ball!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Machine Learning for Kids is intended to be an open creative sandbox to let students invent their own AI-powered projects. But in order to enable that, I create more prescriptive project worksheets to inspire and show what is possible. I&#8217;ve just written another worksheet based around regression models &#8211; a model type that I added [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5220,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[587],"class_list":["post-5200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-mlforkids-tech"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5200"}],"version-history":[{"count":2,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5200\/revisions"}],"predecessor-version":[{"id":5953,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5200\/revisions\/5953"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/media\/5220"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}