INTRODUCTION TO MACHINE LEARNING
COMP2420/COMP6420 INTRODUCTION TO DATA MANAGEMENT, ANALYSIS AND SECURITY
WEEK 3 – LECTURE 1 Monday 07 March 2022
of Computing
Copyright By PowCoder代写 加微信 powcoder
College of Engineering and Computer Science
Credit: (previous course convenor)
Acknowledgement of Country
We acknowledge and celebrate the First Australians on whose traditional lands we meet, and pay our respect to the elders of the Ngunnawal people past and present.
HOUSEKEEPING
Lab enrolment You need to be enrolled in a lab urgently if you are not already.
Assignment 1
Assignment 1 is now available (Due Friday week 6)
Lab-test (week 04)
Carried out in Week 4
Available on Wattle over 3 h period Wednesday of week 04 (1-4pm)
Public Holiday
Canberra Public Holiday Canberra Day 14 March 2022
No live lecture (recording to be provided)
Labs – tutor will either re-schedule or you can go to another lab in that week
CECS Class Representatives
Your class representatives
First name
Learning Outcomes
Describe what is Machine Learning (ML) and how it is different from the traditional approach to programming
02 Explain situations where ML is relevant
Describe the different types of ML and identify when to apply them
Recognise the components of an ML algorithm and apply them as needed
SO, WHAT IS MACHINE LEARNING?
What is Machine Learning? Considered a branch of Artificial Intelligence (AI)
What is Machine Learning?
“Learning is any process by which a system improves performance from experience.” –
“Field of study that gives computers the ability to learn without being explicitly programmed.” –
Computer Scientist and machine learning pioneer . | Source: Machine Learning, McGraw Hill, 1997, . Mitchell
definition (more formal)
Definition by itchell (1997):
Machine Learning is the study of algorithms that
improve their performance P, at some task T,
with experience E.
A well-defined learning task is given by
Levels of Intelligent Behaviour
Reflex: actions are predetermined responses to the input data
More intelligent behavior requires knowledge of the environment and involves such activities as:
Goal seeking Learning
What is Machine Learning?
(shift in CS approach)
• Shift of emphasis from algorithm as main focus of study to data.
• Availability of large datasets (from ~2001)
Example: Hays and Efros (2007) – filling in holes in a photo
, Alexei A. Efros. Scene Completion Using Millions of Photographs. ACM Transactions on Graphics (SIGGRAPH 2007). August 2007, vol. 26, No. 3. (Available at http://graphics.cs.cmu.edu/projects/scene-completion/)
Programming View
Attribution:
Experfy blog
Inferred output
Learnt program
Image credit: Facebook
Where Do We Use Machine Learning?
Not all problems need ML
ML is used when:
1. Human expertise does not exist (e.g. navigating on Mars)
2. Humans can’t explain their expertise (e.g. facial/speech recognition)
3. Models must be customized (e.g. personalized medicine)
4. Models are based on huge amounts of data (e.g. genomics, playing AlphaGo)
5. All changes over time cannot be anticipated (e.g. predicting stock market or changes in room layout)
19 Attribution:E. Alpaydin
What is Deep Learning?
sub-field of Machine Learning focused on algorithms inspired by the structure and function of the brain called artificial neural networks (ANN) and applying those at scale.
I.e. deep learning uses multi- layered ANN
https://machinelearningmastery.com/what-is-deep-learning/ 20
Recognizing handwritten digits with a set of rules is hard!
Attribution: 21
Too many moves to code a strategy!
Attribution:DeepMind 22
Is ML Magic ??
Attribution: 23
Example Areas
Can you give examples of areas where ML can be applied?
Example Areas
• Web search
• Computational biology
• E-commerce
• Space exploration
• Robotics
• Information extraction
• Social networks
• Debugging
• [Your favourite area]
Attribution: 25
Defining the Learning Task
T: Playing go
P: Percentage of games won against an arbitrary opponent
E: Playing practice games against itself
Improve on task T, with respect to performance metric P, based on experience E
T: Recognizing hand-written words
P: Percentage of words correctly classified
E: Database of human-labeled images of handwritten words
T: Driving on four-lane highways using vision sensors
P: Average distance traveled before a human-judged error
E: A sequence of images and steering commands recorded while observing a human driver
Attribution:
TYPES OF MACHINE LEARNING
Types of Machine Learning
Supervised (inductive) learning
Given: training data + desired outputs (labels)
Unsupervised learning
Given: training data (without desired outputs)
Semi-supervised learning
Given: training data + a few desired outputs
Reinforcement learning
Rewards from sequence of actions
Supervised Learning
31 Credit: https://techvidvan.com/tutorials/types-of-machine-learning/
Supervised Learning
32 Credit: https://techvidvan.com/tutorials/types-of-machine-learning/
Reinforcement Learning
33 Credit: https://techvidvan.com/tutorials/types-of-machine-learning/
Supervised Learning
• labeled data available
• Goal: Learn a function that maps input to
Given a training set of N example input-output pairs (!”, #”), (!$, #$),…(!%, #%),
Where each #&was generated by an unknown function y=f(x),
discover a function h that approximates the true function f.
Supervised Learning – Classification and Regression
Classification: when output y is one of a finite set of values [discrete categorical] (e.g. sunny, cloudy or rainy)
Regression: when output y is a real-valued number (e.g. average temperature, height)
Regression Example – Decline of Arctic Sea Ice
Attribution:G. Witt 36
Classification Example – Images
Attribution:G. Witt 37
Hypothesis Space
38 Source: Brookshear (2012) “Computer Science, An overview”, 11th ed.
: Model does not generalize well from training data to unseen data
E.g. 99% accuracy on training data, 50% accuracy on new data
(Underfitting is when model is too simple – makes it difficult to learn from the dataset)
K-fold cross-validation
Use data points for both training and test.
Credit: https://elitedatascience.com/overfitting-in-machine-learning
Popular supervised learning methods
• Decisiontrees
• Supportvectormachines(SVM) • Linearclassifiers
• RandomForest
• K-Nearestneighbour
Unsupervis ed Learning
Unlabeled data (no input-output examples)
(1) Discover groups of similar data points [Clustering]
(2) Determine how data is distributed in the space [Density estimation]
Why unsupervised learning?
• Costly to annotate large datasets so only a few examples can be labeled manually
• There can be cases where we don’t know much about the data e.g. how many classes there are
• Can be used to gain insight into the structure of the data before designing a classifier
43 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Approaches to Unsupervised Learning
• Parametric Unsupervised Learning (e.g. Linear Discriminant Analysis, Gaussian Mixture models and using Expectation-Maximisation algorithm to predict class of sample)
• Non-parametric Unsupervised Learning
(e.g. Clustering)
44 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Unsupervised Learning – Clustering
Most popular method
Concerned with finding structure in a collection of unlabeled data
“Process of organizing data into groups whose members are similar in some way”
45 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Distance-based Clustering
• Data points are grouped into clusters based on the notion of distance between points in such a way that:
• internal distances (within cluster) are small (i..e. members of a cluster are close/similar to each other.
• External distances (outside of cluster) are large (i.e. members of different clusters are dissimilar).
46 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Proximity Measures
• Proximity: how similar/dissimilar data points are to each other
– Similarity measure S(!”, !#); large if !”, !# are similar
– Distance measure D(!”, !#); small if !”, !# are similar
Example: cosine distance for vectors, Euclidean distance
47 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Popular Unsupervised Learning algorithms
• Fuzzy K-means
• Hierarchical clustering
• Mixture of Gaussians
• Affinity Propagation
https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a https://machinelearningmastery.com/clustering-algorithms-with-python/
Clustering – issues
• Large number of dimensions and data set size can get difficult to manage due to time complexity
• Effectiveness of method is dependent on the measure of distance picked for distance-based clustering. It can get tricky to define a good distance measure
• The results can be interpreted in different ways
49 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Clustering – Example applications
• Marketing (finding customers with similar behavior pattern)
• Biology (classify plants and animals given their features)
• Insurance (identifying policy holders with high average claim cost or identifying fraud)
• Web: document classification, weblog data to discover groups of similar access patterns
50 https://towardsdatascience.com/unsupervised-learning-and-data-clustering-eeecb78b422a
Example: unsupervised learning
Identifying topics in documents (free text)
Attribution:G. Discriminant Analysis (LDA)
Reinforcement Learning
Agent learns what to do from success and failure (rewards and punishments) in the absence of labeled examples
Goal: sequentially maximise rewards in a given situation through taking actions and interacting with the environment
E.g. game playing or flying a helicopter
Good overview:
904e2dff5bbc
Reinforcement Learning (cont)
• Environment may be unknown, nonlinear, stochastic and complex
• Agent learns a policy mapping states to actions
àSeeking to maximize its cumulative reward in the long run
(Sutton and Barto, 2015) 53
Reinforcement Learning (summary)
Examples: Credit assignment problem, Game playing, Robot in a maze
Attribution: -oriented learning—learning by interacting with an environment to achieve a goal
more ambitious than other kinds of machine learning
Learning by trial and error, with only delayed evaluative feedback (reward)
the kind of machine learning most like natural learning
learning that can tell for itself when it is right or wrong
RL : Markov Decision Process
Markov decision process (MDP) — A probabilistic model of a sequential decision problem, where states can be perceived exactly, and the current state and action selected determine a probability distribution on future states.
i.e. the outcome of applying an action to a state depends only on the current action and state (and not on preceding actions or states).
RL Challenge
Exploration vs Exploitation
To obtain a lot of reward, an RL agent must prefer actions it has tried in the past and found to be rewarding. But to discover such action (or better) it has to try actions not selected before.
A trade-off is needed
Reinforcement Learning – example
Attribution:DeepMind 57
Designing a Learning System
1. Choose the training experience
2. Choose exactly what is to be learned – i.e. the target function
3. Choose how to represent the target function
4. Choose a learning algorithm to infer the target function from the experience
Learning System
Attribution: 60
ML in a Nutshell
• Tens of thousands of machine learning algorithms
• Hundreds new every year
• Every machine learning algorithm
has three components:
– Representation – Evaluation
– Optimization
Attribution:
Representation
• Instances
• Graphical models (Bayes/Markov nets)
• Neural networks
• Support vector machines
• Model ensembles
• Etc. Attribution:
• Decision trees
• Sets of rules / Logic programs
Evaluation
• Accuracy
• Precision and recall
• Squared error
• Likelihood
• Posterior probability
• Cost / Utility
• K-L divergence
• Etc. Attribution:
Optimization
• Combinatorial optimization – E.g.: Greedy search
• Convex optimization
– E.g.: Gradient descent
• Constrained optimization
– E.g.: Linear programming
Attribution:
ML in Practice
• Understanding domain, prior knowledge, and goals
• Data integration, selection, cleaning, pre-processing, etc.
• Learning models
• Interpreting results
• Consolidating and deploying discovered knowledge
• Loop Attribution:
Lessons to Keep in Mind
• We generally assume that the training and test examples are independently drawn from the same overall distribution of data
– We call this “i.i.d:” which stands for “independent and identically distributed”
• Learning can be viewed as using direct or indirect experience to approximate a chosen target function.
• Different learning methods assume different hypothesis spaces (representation languages) and/or employ different search techniques.
Attribution:
Live coding (next)
Application-oriented course.
Practice is important to support your learning.
Mindika will go through some live coding next.
Notebook available.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com