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

slides-1_intro_day1

The document provides an overview of machine learning, data science, and artificial intelligence, explaining their definitions, differences, and applications. It discusses various types of learning, including supervised, unsupervised, and reinforcement learning, as well as the roles of data engineers and data scientists. Additionally, it highlights the importance of generalization in machine learning and the challenges associated with AI technology.

Uploaded by

vineetpjoshi.71
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

slides-1_intro_day1

The document provides an overview of machine learning, data science, and artificial intelligence, explaining their definitions, differences, and applications. It discusses various types of learning, including supervised, unsupervised, and reinforcement learning, as well as the roles of data engineers and data scientists. Additionally, it highlights the importance of generalization in machine learning and the challenges associated with AI technology.

Uploaded by

vineetpjoshi.71
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

Introduction of machine learning

 At a basic level, machine learning is about predicting the future based on the past.

 For instance, you might wish to predict how much a user Alice will like a movie that
she has t see , ased o he ati gs of o ies that she has see .

 This means making informed guesses about some unobserved property of some
object, based on observed properties of that object.

The fi st uestio e ll ask is: hat does it ea to lea ? I o de to de elop lea i g


machines, we must know what learning actually means, and how to determine success
(or failure).
Introduction of machine learning

 Alice has just begun taking a course on machine learning. She knows that at the end
of the ou se, she ill e e pe ted to ha e lea ed all about this topic.

 A common way of gauging whether or not she has learned is for her teacher, Bob, to
give her a exam. She has done well at learning if she does well on the exam.

 But what makes a reasonable exam? If Bob spends the entire semester talking about
machine learning, and then gives Alice an exam o Histo of Potte , the Ali e s
performance on this exam will not be representative of her learning.

 On the other hand, if the exam only asks questions that Bob has answered exactly
during lectures, then this is also a ad test of Ali e s lea i g, espe iall if it s a
ope otes e a .
Introduction of machine learning

 What is desired is that Alice observes specific examples from the course, and then
has to answer new, but related questions on the exam.

 This tests whether Alice has the ability to generalize. Generalization is perhaps the
most central concept in machine learning
Example of machine learning
Machine learning works with structured data to detect patterns that provide insight.
Everyday examples are personalized recommendations from services like Amazon or
Netflix. In the financial arena, machine learning predicts bad loans, finds risky applicants,
and generates credit scores.
Data science

 Data science is a "concept to unify statistics, data analysis, machine learning and
their related methods" in order to "understand and analyze actual phenomena" with
data.

 Data science employs techniques and theories drawn from many fields within the
broad areas of mathematics, statistics, information science, and computer science,
in particular from the subdomains of machine learning, data mining, databases, and
visualization.
Data science

The definition of data science thus emphasizes:

Statistical inference
Data visualization
Experiment design
Domain knowledge
Communication
Difference between data science, machine learning, and artificial
intelligence

The fields do have a great deal of overlap, but the e ot interchangeable

 Data science produces insights


 Machine learning produces predictions
 Artificial intelligence produces actions
What is artificial intelligence(AI) – (1)?

 AI is the science and engineering of making intelligent machines, especially intelligent


computer programs.

 It is related to the similar task of using computers to understand human intelligence,


but AI does not have to confine itself to methods that are biologically observable.
What is artificial intelligence(AI) – (2)?
 A tifi ial I tellige e AI is the o ept of ha i g a hi es thi k like hu a s — in
other words, perform tasks like reasoning, planning, learning, and understanding
language.

 While no one is expecting parity with human intelligence today or in the near future,
AI has big implications in how we live our lives.

 The brains behind artificial intelligence is a technology called machine learning, which
is designed to make our jobs easier and more productive.
What are the main challenges with AI technology?

 Think of AI as an iceberg. What you see as a user is just the tip — but beneath the
surface lurks a behemoth support system of data scientists and engineers, massive
amounts of data, labor-intensive extraction and preparation of that data, and a huge
technology infrastructure.

 It takes a specialized team of data scientists and developers to access the correct
data, prepare the data, build the correct models, and then integrate the predictions
back into an end-user experience such as CRM.

 We e desig ed Salesfo e Ei stei so that all those halle ges a e ou s i stead of


yours. That means everyone can now use AI to work smarter in their CRM.
Use AI in the enterprise
Until now, AI was so complex and cost-prohibitive that only a select few were able to use
it in a truly meaningful way. Salesforce Einstein changes that forever. Now everyone in
any organization can easily use AI to analyze their data, predict and plan next steps, and
auto ate thei tasks a d de isio s. With Ei stei s o p ehe si e AI fo CRM:

 Sales can anticipate next opportunities and exceed customer expectations by knowing
what a customer needs before the customer does
 Service can deliver proactive service by anticipating cases and resolving issues before
they become problems
 Marketing can create predictive journeys and personalize customer experiences like
never before
 IT can embed intelligence everywhere and create smarter apps for employees and
customers
What is deep learning
Deep learning is AI that uses complex algorithms to perform tasks in domains where it
actually learns the domain with little or no human supervision. In essence, the machine
learns how to learn.
Example of deep learning
While the e s lots of e iti g e pe i e tatio happe i g ith deep lea i g, ost
p a ti al appli atio s ou e fa ilia ith a e ased o i age a al sis. With i age
analysis, a computer learns to classify random images by analyzing thousands or millions
of other images and their data points. For example, consumer apps like Google Photos and
Facebook use deep learning to power face recognition in photos.
What is natural language processing (NLP)?
NLP is AI that recognizes language and its many usage and grammar rules by finding
patterns within large datasets.
Example of language processing (NLP)
O e appli atio of NLP that s gai i g t a tio is se ti e t a al sis ithi so ial edia.
Computers use algorithms to look for patterns in user posts across Twitter, Facebook, or
other social networks to understand how customers feel about a specific brand or product.
Data engineers
Data engineers are the designers, builders and managers of the information or "big data"
infrastructure. They develop the architecture that helps analyze and process data in the
way the organization needs it. And they make sure those systems are performing
smoothly. Data science is a team sport.
Role of Data engineers
 Big data engineers develop, maintain, test and evaluate big data solutions within
organizations. Most of the time they are also involved in the design of big data
solutions, because of the experience they have with Hadoop based technologies such
as MapReduce, Hive MongoDB or Cassandra.

 Data engineers are also responsible for the creation and maintenance of analytics
infrastructure that enables almost every other function in the data world. They are
responsible for the development, construction, maintenance and testing of
architectures, such as databases and large-scale processing systems
Data Scientists vs. Data Engineers
Algorithms in ML
Types of Learning
• Supervised learning
• Goal: Prediction
• Unsupervised learning
• Goal: Discovery
• Reinforcement learning
Supervised Learning
Learn how to predict an output from a
given input.

• Given a photo, identify who is in it


• Given an audio clip, identify the song
• Given a patient’s medical history,
estimate how likely they will need
follow-up care within a month
Supervised Learning
Two types of prediction:
• Classification
• Discrete outputs (typically categorical)
• Regression
• Continuous outputs (usually)

If you need to brush up on these definitions,


read Ch. 1 of OpenIntro Statistics.
Classification
• Document classification
• Is this email spam?
• Is this tweet positive toward this product?
• Is this review/article real?
• Image classification
• Is this a photo of a cat?
• Which letter or number is written here?
• Object recognition
• Identify the faces in this image
• Identify pedestrians in this video
Classification
A classification algorithm is called a classifier

Classifiers require examples of inputs paired


with outputs
• Called training data

Classifiers learn from training examples to


map input to output
• Then when a classifier encounters new data where
the output is unknown, it can make a prediction
Let’s build a classifier

A B C Prediction
13 N N Y
15 N Y N
16 N N Y
22 N Y N
28 Y N Y
41 N N N
Let’s build a classifier

A B C Prediction
14 N Y ?
15 N N ?
17 Y Y ?
26 N Y ?
30 Y N ?
30 N N ?
Let’s build a classifier

A B C Prediction
14 N Y N
15 N N Y
17 Y Y Y
26 N Y N
30 Y N Y
30 N N N
Let’s build a classifier
What are we predicting?
“Will this consumer like the
new Taylor Swift single?”

What are the features?


A = age of consumer (years)
B = did this person purchase Taylor Swift’s
previous album? (yes/no)
C = does this person like Kanye West? (yes/no)
Let’s build a classifier

Age Previous Likes Likes New  


Purchase Kanye TSwift
13 N N Y
15 N Y N
16 N N Y
22 N Y N
28 Y N Y
41 N N N
Let’s build a classifier: takeaway
Lots of rules match the original data
• Most rules won’t work on new data
• Need to be able to generalize

This is hard to do without knowing what


the variables mean
• A machine learning algorithm won’t know what
they mean, either (unless you tell it)
• Some heuristics: use rules with lots of
evidence; use rules that are simple
Supervised Learning
Recipe for supervised machine learning:

Pattern matching + generalization


Supervised Learning
Two types of prediction:
• Classification
• Discrete outputs (typically categorical)
• Regression
• Continuous outputs (usually)
Regression

Linear regression with one input variable


Regression
Examples:
• Predicting how much money a movie will make
• Forecasting tomorrow’s high temperature
• Estimate someone’s age based on their face
• Rate how strongly someone likes a product
(e.g., in a tweet)
Types of Learning
• Supervised learning
• Goal: Prediction
• Unsupervised learning
• Goal: Discovery
• Reinforcement learning
Unsupervised Learning
Finding “interesting” patterns in data
• Not trying to predict any particular variable
• No training data
• Maybe you don’t even know what you’re
looking for

Example: anomaly detection


• Trying to identify something unusual (e.g.,
fraud) but you don’t know what it looks like
Unsupervised Learning
Clustering is an unsupervised learning
task that involves grouping data instances
into categories
• Similar to classification, but you don’t know
what the classes are ahead of time
Unsupervised Learning
Example: movie recommendation (the
Netflix problem)
• Clustering can be used to put people into
different groups based on the kinds of movies
they like.

Interest  Group  3: Interest  Group  18: Interest  Group  8:


Trainspotting Mary  Poppins Pretty  Woman
Fargo Cinderella Mrs.  Doubtfire
Pulp  Fiction The  Sound  of  Music Ghost
Clerks Dumbo Sleepless  in  Seattle
From  Hoffman  (2004)  “Latent  Semantic  Models  for  Collaborative  Filtering.”
Classification Regression

Clustering
Semi-supervised Learning
Combines both types of learning

Really just a special case of supervised


learning
• You have a specific prediction task, but some
of your data has unknown outputs
Types of Learning
• Supervised learning
• Goal: Prediction
• Unsupervised learning
• Goal: Discovery
• Reinforcement learning
Reinforcement Learning
Setting:
• an agent interacts with an environment
• actions by the agent lead to different
states of the environment
• some states will provide rewards

Learning goal is to maximize rewards.


Used to learn models of how to behave,
more complex than just input→output
Reinforcement Learning
Most commonly used for creating robots
and automated vehicles
Can also learn to play games

Some uses in more traditional machine


learning tasks by creatively defining what
the agent and environment are
Pause
Terminology
Each data point (i.e., each “thing” you are
classifying/regressing/clustering) is called
an instance
• Alternative name: observation
• Also called examples or samples when used as
training data in supervised learning

In a data set, each row corresponds to an


instance.
Terminology
The “input” variables are called features
• Alternative names: attributes, covariates
• Also referred to as the independent variables

In a data set, each column corresponds to a


feature. (Except for the last column, which is the
output.)

The list of feature values for an instance is called


the instance’s feature vector
Terminology
The value of the “output” variable (the
“thing” you are trying to predict) is the label
• Also called the dependent variable

In a data set, this is the final column. (Unless there


is more than one label, which is a setting we will
consider later in the course.)

In classification, the possible values the labels can


have are called classes
Terminology
In supervised learning:
• a training instance is a feature vector
paired with a label
• the training data (sometimes labeled data)
is the table of all training instances

In unsupervised learning, the data set


contains feature vectors but no labels
(sometimes called unlabeled data)
Prediction
A prediction function is what you get at
the end of learning
• Sometimes called a predictor (but features are
also sometimes called predictor variables, so
this can get confusing)
• Sometimes called a hypothesis

A classifier is what you call a prediction


function if you are doing classification.
Prediction
Example of a simple prediction function:
y = .17x + 5
Prediction
Where does this function come from?
Need to learn it so that it is accurate.
What is accurate?
Need to define the error or loss of a
prediction function.
• For classification, this is usually the probability
that the classifier will output the correct label.
• For regression, this is usually measured by
how far away the predicted value will be.
Prediction
There is some hypothetical measure of
how well a classifier will do on all data it
might encounter (the true error or risk)

But there’s probably no way to measure


that… usually you can only measure the
error or loss on the training data, called
the training error
• Alternatively: empirical error/risk
Prediction
Goal of machine learning is to learn a
prediction function that minimizes the
(true) error.

Since true error is unknown, instead


minimize the training error.
… … … … …
From:  https://xkcd.com/1122/
Generalization
Prediction functions that work on the
training data might not work on other data

Minimizing the training error is a


reasonable thing to do, but it’s possible to
minimize it “too well”
• If your function matches the training data well
but is not learning general rules that will work
for new data, this is called overfitting
Generalization

From:  https://www.quora.com/Whats-­‐the-­‐difference-­‐between-­‐overfitting-­‐and-­‐underfitting
Generalization
Restrictions on what a classifier can learn
is called an inductive bias

Inductive biases are an important (and


actually necessary) ingredient to learning
classifiers that will generalize to new data
Generalization
One type of bias: don’t use certain features
Age Previous Likes Likes New  
Purchase Kanye TSwift
13 N N Y
15 N Y N
16 N N Y
22 N Y N
28 Y N Y
Generalization
One type of bias: don’t use certain features
Age Electric   Likes Likes New  
Toothbrush Kanye TSwift
13 N N Y
15 N Y N
16 N N Y
22 N Y N
28 Y N Y
We know from common sense that
this is probably irrelevant, and any
association is a coincidence
Generalization
Another type of bias: restrict what kind of
function you can learn

Linear functions (lines or planes) are so simple that they


won’t overfit, even if they aren’t perfect on training data
Generalization
We’ll discuss other types of inductive bias
(some automatic) that can help with
generalization throughout the semester
Almost done
Uncertainty
When making a prediction, there is some
uncertainty (by definition)

Many machine learning models can


estimate the probability that a particular
prediction is correct
Machine Learning in Practice

You might also like