0% found this document useful (0 votes)
7 views

Machine learning workbook (1)

Uploaded by

kashvipunj5
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Machine learning workbook (1)

Uploaded by

kashvipunj5
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Year 9 STEM

Introduction to AI
Teacher Resource

UNIT 3 – MACHINE LEARNING


1. Key terminology

Define the following terms in your own words.

Term Definition
Machine Learning A sub concept of artificial intelligence that involves algorithms and key statistical data that can
enable specific computers to perform tasks, without specific instructions therefore relying on
patterns and inference
Supervised Learning A form of machine learning in which algorithms are trained to recognise patterns to predict
outcomes. Supervised learning algorithms are provided with data labels which help to recognise
the comparison between input and output.
Unsupervised Learning Another form of machine learning however is a type of machine that learns from unlabelled
data, therefore having to discover and analyse patterns without labels or guidance from
humans.
Reinforcement Learning A form of machine learning where the machine is trained to make decisions and choices to find
the correct outcome. The agent receives feedback in the form of rewards allowing it to form
strategies to obtain the best result in decision making.
Classification A branch of supervised learning in which the machine must recognise patterns to label certain
input data sets the correct way.

2. Nearest Neighbour Classifier (Customers Who Bought Similar Items)

In this exercise, you will build a simple recommendation system for an online shopping application where the users' purchase
history is recorded and used to predict which products the user is likely to buy next.

You have data from six users. Below is recorded the data from the recent shopping history of each user – four items they bought
and then the item they bought next:

User Shopping History Next Purchase


Sanni Boxing Gloves Moby Dick (novel) Headphones Sunglasses Coffee Beans
Jouni T-Shirt Coffee Beans Coffee Maker Coffee Beans Coffee Beans
Janina Sunglasses Sneakers T-Shirt Sneakers Socks
Henrik 2001: A Space Odyssey (DVD) Headphones T-Shirt Boxing Gloves Thongs
Ville T-Shirt Thongs Sunglasses Moby Dick (novel) Sunscreen
Teemu Moby Dick (novel) Coffee Beans 2001: A Space Odyssey Headphones Coffee Beans
(DVD)

The most recent purchase is the one in the rightmost column, so for example, after buying 2001: A Space Odyssey (DVD),
headphones, a t-shirt and boxing gloves, Henrik bought thongs. The hypothesis is that after buying similar items, other users are
also likely to buy thongs.

To apply the nearest neighbour method, we need to define what we mean by nearest. This can be done in many different ways,
some of which work better than others. Let’s use the shopping history to define the similarity (“nearness”) by counting how
many of the items have been purchased by both users.

For example, users Ville and Henrik have both bought a t-shirt, so their similarity is 1. Note that thongs doesn't count because
we don't include the most recent purchase when calculating the similarity — it is reserved for another purpose.

Your task is to predict the next purchase of customer Travis who has bought the following products:

User Shopping History Purchase


Travis Green Tea T-Shirt Sunglasses Thongs Sunscreen ?
You can think of Travis being the test data, and the above six users make the training data.

Proceed as follows:

1. Calculate the similarity of Travis relative to the six users in the training data (done by adding together the number of
similar purchases by the users).

User Similarity Score


Sanni 1
Jouni 1
Janina 2
Henrik 2
Ville 3
Teemu 0

2. Having calculated the similarities, identify the user who is most similar to Travis by selecting the largest of the
calculated similarities.
3. Predict what Travis is likely to purchase next by looking at the most recent purchase (the rightmost column in the table)
of the most similar user from the previous step.

Who is the use most similar to Travis? – Ville

What is the predicted purchase for Travis? - Sunscreen

3. Filter Bubbles

Recommending news or social media content that a user is likely to click or like, may lead to filter bubbles where the users only
see content that is in line with their own values and views.

1. Do you think that filter bubbles are harmful? After all, they are created by recommending content that the user likes.
What negative consequences, if any, may be associated with filter bubbles? Feel free to look for more information
from other sources.

Filter bubbles are quite ideological and interpretive. They can be both a positive and negative system. There are
various negative consequences involved in filter bubbles however a major concern is that people’s views and opinions
would reflect onto their filter bubble, and it can cause fuel to a moral which may have a negative effect. For example, if
someone is passionate about a certain opinion, that is all they are going to be exposed to. This can lead to a reduction
of world views and the person may never have any opportunities to explore different opinions or interests other than
their own. This makes people less likely to reconsider alternative perspectives which can in turn lead to a lack of
empathy and a disconnection from people who may share different opinions.

2. Think of ways to avoid filter bubbles while still being able to recommend content to suit personal preferences. Come
up with at least one suggestion. You can look for ideas from other sources, but we'd like to hear your own ideas too!

1. People love what they love, and it is totally valid for a person to prefer seeing their favourite things via the algorithm.
However different opinions, interests, perspective etc can be helpful and healthy to a person. A way to maintain the
balance of the filter bubble is to have the algorithm reduce its ability to adjust to behaviour. The algorithm should only
respond to interests of the user and compare them to either opposing or similar interest, rather than focusing on the
behaviour of the user and adjusting off that data (e.g. recommending similar artists to the ones they are interested in
rather than the same one)

2. Another way to avoid filter bubbles while still being able to recommend content to suit personal preferences (this
time as the user) is to constantly seek new information. A simple YouTube search on a topic you are slightly interested
in can completely switch up the algorithm to start sharing and recommending videos along the lines of what you
searched.
Note: your answer should be at least a few sentences for each part.

4. Data Quality

Explain why data quality matters in machine learning and explain the potential problems caused by biased data.

Data learning is quite essential in the branch of machine learning. The increased quality o f data can lead to many benefits.
The better the data the better the models’ predictions. Accurate predictions create the improved use of the specific app or
machine and the overall success of the machine learning. For example, if the data is complicated, inaccurate, or biased it can
lead to wrong decisions and results by the model. The model may receive biased data and therefore work incorrectly. For
example, if a face recognition app has only been tested with lighter skinned people it may not function correctly when
encountered with someone with a darker skin complexion. This is all a potential risk when a machine isn’t presented with
accurate or unbiased data. To avoid these problems, we need to ensure the system works correctly and is fair by using
accurate, diverse data and check for any biases in the data.

5. Machine Learning

You are going to develop your own machine learning experiments using the teachable machine interface at
https://teachablemachine.withgoogle.com To do this, you will experiment with each of the three projects available: image
project, audio project, and pose project. You will then consider how each of the three projects could be applied to solving real
world problems.

As you create each experiment and engage with each of the projects, complete the below information.

Project 1:

Project Type: image, audio or pose Audio


Project Description: What did your Recognise language
project attempt to classify?
Data Sets: How did you create data Self-created datasets consisting of audio recordings in various languages, featuring
sets – what reference material and a diverse range of words.
labels did you use?
How did you ensure data quality? The recordings maintain clear sounds with minimal mumbling. A substantial volume
of data has been collected.
How could your project be applied to For translation needs in any country, a machine learning audio project designed for
solving real world problems – which teaching purposes would be an effective solution.
problem(s) could this project solve?

Include screen shots below of your project working below. Explain any problems you had training the machine and how you
overcame these.

Project 2:
Project Type: image, audio or pose image
Project Description: What did your Recognising different faces
project attempt to classify?
Data Sets: How did you create data A large volume of data of each class representing the different faces it had to
sets – what reference material and recognise.
labels did you use?
How did you ensure data quality? Many trials and multiple variations of the faces to ensure consistency in recognition.
How could your project be applied to Face recognition such as opening a phone and having security higher than a pin or
solving real world problems – which password.
problem(s) could this project solve?

Include screen shots below of your project working below. Explain any problems you had training the machine and how you
overcame these.

Project 3:

Project Type: image, audio or pose pose


Project Description: What did your Recognise Different poses
project attempt to classify?
Data Sets: How did you create data Making the exact same poses for it to recognise . We used a webcam to capture the
sets – what reference material and pose and points of the pose.
labels did you use?
How did you ensure data quality? Consistency in many poses with the same movements and no movement
whatsoever. A lot of trials ensured a consistent result.
How could your project be applied to A pose recognition to unlock certain things and enter places via a pose.
solving real world problems – which
problem(s) could this project solve?

Include screen shots below of your project working below. Explain any problems you had training the machine and how you
overcame these.

You might also like