Machine Learning Basics - SSS 2 Note
MACHINE LEARNING BASICS
Class: SSS 2
Term: Second Term
Week: 10
Topic: Machine Learning Basics
Duration: 80 Minutes (Double Period)
Learning Objectives
By the end of the lesson, students should be able to:
- Explain the meaning of machine learning.
- Describe the relationship between Artificial Intelligence and Machine Learning.
- Identify simple applications of machine learning.
- Explain how systems learn from data.
- Describe basic stages involved in developing a machine-learning system.
- Identify benefits, limitations and responsible practices associated with machine learning.
1. Introduction
Digital systems are increasingly able to recognise patterns, make predictions and provide suggestions. For example, an email service may identify unwanted messages, a music application may recommend songs, and a phone may predict the next word a person intends to type.
Some of these activities use machine learning. Instead of relying only on rules written by a programmer for every possible situation, a machine-learning system uses data to identify patterns that can help it make predictions or decisions.
2. Meaning of Machine Learning
Machine learning does not mean that a computer learns exactly like a human being. It means that a computer program uses examples or feedback to build a model that can perform a particular task.
Example
Imagine an email service that receives many messages. Some messages are normal, while others are unwanted advertisements or fraudulent messages called spam. By analysing examples of messages labelled as spam or not spam, a machine-learning system can learn patterns that help it identify similar messages in the future.
The system may consider features such as suspicious links, repeated phrases and unusual sending patterns. It does not understand every message perfectly, so some messages may still be classified incorrectly.
3. Relationship Between Artificial Intelligence and Machine Learning
Artificial Intelligence (AI) is the broader field concerned with creating computer systems that perform tasks associated with human intelligence, such as recognising speech, solving problems, making recommendations or interpreting information.
Machine Learning (ML) is one of the approaches used to develop AI systems. It allows systems to learn useful patterns from data rather than depending entirely on manually written rules.
| Artificial Intelligence (AI) | Machine Learning (ML) |
|---|---|
| The broader field of developing systems that perform intelligent tasks. | An approach that uses data to learn patterns for predictions or decisions. |
| May use rules, logic, machine learning and other techniques. | Uses examples or data to build a model for a particular task. |
| Examples include rule-based expert systems and some speech assistants. | Examples include spam filters and recommendation systems that learn from user activity. |
Simple Illustration
Consider a system designed to identify ripe and unripe tomatoes:
- An AI system is the overall system designed to perform the identification task.
- A machine-learning approach can use labelled examples of ripe and unripe tomatoes to learn patterns.
- The trained model can then examine a new tomato image and predict whether the tomato is ripe or unripe.
The prediction may be incorrect if the image is unclear or the training examples are not suitable.
4. How Machine Learning Systems Learn from Data
A machine-learning system generally follows several stages. The exact process depends on the task and the type of model being used.
- Collect data: Gather relevant examples, such as labelled pictures, customer transactions or email messages.
- Prepare the data: Check for errors, remove unnecessary information and organise the examples.
- Train the model: Use the training data to help the system identify useful patterns.
- Test the model: Evaluate its performance using examples that were not used for training.
- Use the model: Allow the model to make predictions or classifications on new data.
- Monitor and improve: Check its performance over time and update it when necessary.
| Stage | Example: Email Spam Detection |
|---|---|
| Data collection | Gather examples of normal emails and spam emails. |
| Data preparation | Organise the messages and check their labels. |
| Training | Allow the model to identify patterns associated with spam. |
| Testing | Check how well the model classifies previously unseen messages. |
| Prediction | Classify a new email as likely spam or not spam. |
| Monitoring | Check errors and improve the system as spam patterns change. |
5. Basic Types of Machine Learning
There are different approaches to machine learning. Three common types are supervised learning, unsupervised learning and reinforcement learning.
5.1 Supervised Learning
Supervised learning uses examples that already have known answers, called labels. The system learns patterns connecting the input data with the correct answers.
Example: Training a system with labelled pictures of cats and dogs so that it can classify new pictures.
5.2 Unsupervised Learning
Unsupervised learning uses data without supplied answer labels. The system looks for patterns, similarities or groups within the data.
Example: Grouping customers according to similarities in their shopping habits without giving the system the groups in advance.
5.3 Reinforcement Learning
Reinforcement learning involves an agent learning through actions and feedback from an environment. Rewards or penalties help guide its future actions.
Example: A computer program learning to play a game by trying different moves and receiving rewards for successful actions.
6. Simple Applications of Machine Learning
Machine learning is used in many digital services and industries.
| Application | How Machine Learning May Be Used |
|---|---|
| Email spam filtering | Identifies patterns that may indicate unwanted or fraudulent messages. |
| Recommendation systems | Suggests videos, music, books or products based on patterns in user activity. |
| Predictive text | Suggests likely words or phrases as a person types. |
| Speech recognition | Helps convert spoken words into text or commands. |
| Image recognition | Classifies images or identifies objects in pictures. |
| Weather and traffic prediction | Uses historical and current data to estimate likely conditions or traffic patterns. |
| Fraud detection | Identifies transactions with patterns that may indicate fraudulent activity. |
| Agriculture | May help identify crop diseases from images or estimate crop conditions using data. |
| Education | May help identify learning patterns and recommend practice activities. |
7. Systems That Learn from Data
A system that learns from data uses examples or feedback to build or update a model. When it receives new information, it uses the learned patterns to make a prediction, classification or recommendation.
Examples
- Email filters: Learn patterns that help separate unwanted messages from normal emails.
- Music and video platforms: Use patterns in listening, viewing or rating activity to recommend content.
- Predictive text: Uses language patterns to suggest likely next words.
- Online shopping platforms: May recommend products based on browsing and purchase patterns.
- Image classification systems: Learn from example images to classify new images.
Classroom Illustration: Classifying Messages
The following small dataset shows how labelled examples could be used to explain supervised learning. The examples are simplified for classroom discussion and are not sufficient to train a reliable real-world spam filter.
| Sample Message | Label | Possible Clue |
|---|---|---|
| Our class test is on Monday. | Not spam | Ordinary classroom information |
| Congratulations! You have won a prize. Click this suspicious link. | Spam | Unexpected prize claim and suspicious link |
| Please bring your textbook tomorrow. | Not spam | Normal school reminder |
| Claim a guaranteed reward now by sending your password. | Spam | Unusual reward claim and request for sensitive information |
From these examples, students can discuss how a system might identify patterns. However, a message should not be labelled spam based on one word alone. Real systems need much larger and more varied datasets and should be tested carefully.
8. Benefits of Machine Learning
- Automation: Helps computers perform repetitive classification and prediction tasks.
- Pattern recognition: Can identify relationships in large amounts of data.
- Personalisation: Can make recommendations suited to individual users.
- Prediction: Can estimate likely outcomes from available data.
- Efficiency: Can process data faster than people could manually in some tasks.
- Improvement through updates: Models can be retrained or updated when better data becomes available.
9. Limitations and Responsible Use
Machine learning is useful, but it does not always produce correct or fair results.
- Poor data quality: Incorrect, incomplete or outdated data can lead to poor predictions.
- Bias: If the examples used to train a model are unbalanced or unfair, its results may also be unfair.
- Errors: A model can make incorrect predictions, even when it has been tested.
- Privacy: Personal information must be handled carefully and lawfully.
- Security: Data and systems must be protected from unauthorised access.
- Misuse: Machine learning can be used to produce misleading content or support harmful activities.
- Human judgement: Important decisions should not rely blindly on a model, especially where mistakes could cause harm.
10. Class Activity
Activity: Identify how a system could learn from data.
- Work individually or in small groups as directed by the teacher.
- Choose one example, such as spam filtering, product recommendations or image classification.
- List the type of data the system might use.
- Explain the patterns the system might try to identify.
- Describe what prediction or recommendation it could produce.
- Identify one possible error and one way to use the system responsibly.
- Present your explanation to the class.
11. Summary
Machine learning is an approach within Artificial Intelligence that allows computer systems to learn patterns from data. AI is the broader field, while machine learning is one of the methods used to build AI systems. Common types include supervised learning, unsupervised learning and reinforcement learning. Applications include spam filtering, recommendations, speech recognition, image classification, fraud detection and prediction. Machine-learning systems depend on data and can make mistakes, so accuracy, fairness, privacy and human oversight are important.
12. Evaluation Questions
- Define machine learning.
- Explain the relationship between Artificial Intelligence and Machine Learning.
- State four applications of machine learning.
- List and explain three basic types of machine learning.
- Outline five stages involved in developing or using a machine-learning model.
- Explain how an email spam filter may learn from data.
- State three benefits of machine learning.
- Mention four limitations or risks of machine learning.
13. Assignment
Answer the following questions in your notebook:
- Explain the meaning of machine learning in your own words.
- Give five examples of systems or services that may use machine learning.
- Describe how a recommendation system can use data to suggest videos or music.
- Explain the difference between supervised learning and unsupervised learning.
- State four precautions that should be taken when using machine-learning systems.
14. Interactive Revision Quiz
Choose one answer for each question. Click Mark Quiz to see your score.
Comments
Post a Comment