0% found this document useful (0 votes)
83 views29 pages

Chapter #4 - Machine Learning

This document discusses supervised and unsupervised learning in machine learning. It begins by defining supervised learning as learning that occurs under supervision using labeled training data. Classification and regression are described as the two types of supervised learning problems, where classification predicts categorical outputs and regression predicts continuous outputs. An example of spam detection using classification is provided. Unsupervised learning is also introduced but not described in detail.

Uploaded by

mzoon mohmmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views29 pages

Chapter #4 - Machine Learning

This document discusses supervised and unsupervised learning in machine learning. It begins by defining supervised learning as learning that occurs under supervision using labeled training data. Classification and regression are described as the two types of supervised learning problems, where classification predicts categorical outputs and regression predicts continuous outputs. An example of spam detection using classification is provided. Unsupervised learning is also introduced but not described in detail.

Uploaded by

mzoon mohmmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Fahad bin sultan university

College of Computing
MSC 536 - Selected Topic in Artificial Intelligence
CEN 526 - Artificial Intelligence
Machine Learning

Spring 2022-2023
Dr. Mohammad Hujooj

Computer Science and IT | College of Computing |


Supervised and Unsupervised Learning in Machine
Learning

• What is Supervised Learning?


• Real-Life Applications of Supervised Learning

Spring 2022-2023
• What is Unsupervised Learning?
• Real-Life Applications of Unsupervised
Learning
• Difference Between Supervised and
Unsupervised Learning

Computer Science and IT | College of Computing | 2


Machine Learning

• Machine Learning is the science of making computers learn and act like
humans by feeding data and information without being explicitly

Spring 2022-2023
programmed.
• Machine learning algorithms are trained with training data. When new
data comes in, they can make predictions and decisions accurately
based on past data.

ّ ّ ّ
‫ منخال لإدخا ال لبياناتوا ملعلوماتدو "ن‬،‫وتتصرفك ا لبشر‬ ‫ت علم ا آللة" هي علم يتعلق ب جع لا لح واسيبت تعلم‬
‫ا لحاجة إ لى ب رمجة ص ريحة‬.
ّ
‫ تستطيع‬،‫ وعندما تأتي بيانات جديدة‬،‫يتم تدريب خوارزميات تعلم اآللة باستخدام بيانات تدريبية‬
ً
‫الخوارزميات إجراء تنبؤات واتخاذ قرارات دقيقة استنادا إلى البيانات السابقة‬.

Computer Science and IT | College of Computing | 3


Machine Learning………….

• For example, whenever you ask Siri to do something, a powerful


speech recognition converts the audio into its corresponding
textual form. This is sent to the Apple servers for further processing

Spring 2022-2023
where language processing algorithms are run to understand the
user's intent. Then finally, Siri tells you the answer.
ُ
‫ يتم تحويل الصوت‬،‫ عندما تطلب من سيري فعل شيء ما‬،‫على سبيل املثال‬
‫ يت م إرس ال الن ص إل ى‬.‫إل ى ن ص م ن خالل تقني ة قوي ة للتعرف عل ى الكالم‬
ً
‫ حيث يتم تشغيل خوارزميات معالجة‬،‫خوادم آبل للمعالجة األكثر تفصيال‬
.‫ ثم يخبرك سيري اإلجابة النهائية‬.‫اللغة لفهم نية املستخدم‬

Computer Science and IT | College of Computing | 4


There are two types of machine learning:

Spring 2022-2023
1. Supervised Learning
2. Unsupervised Learning

Computer Science and IT | College of Computing | 5


Spring 2022-2023
Computer Science and IT | College of Computing | 6
Spring 2022-2023
Computer Science and IT | College of Computing | 7
What is Supervised Learning?

In Supervised Learning, the machine learns under supervision. It


contains a model that is able to predict with the help of a labeled
dataset. A labeled dataset is one where you already know the target

Spring 2022-2023
answer.
ً ً ّ ّ ّ ‫في التعلم‬
‫ يتعلم الجهاز بإشراف ويتضمن نموذجا قادرا على التنبؤ‬،‫املوجه‬
‫ وتعرف املجموعات التي‬.‫بمساعدة مجموعة بيانات تحتوي على تسميات‬
‫ يعني هذا أنه‬."‫تحتوي على تسميات سابقة بـ "مجموعات البيانات املسماة‬
ً‫ تعرف اإلجابة املستهدفة مسبقا‬،‫في مجموعات البيانات املسماة‬.

Computer Science and IT | College of Computing | 8


What is Supervised Learning?.............

Spring 2022-2023
Computer Science and IT | College of Computing | 9
What is Supervised Learning?.............

In previous case, we have images that are labeled a spoon or a knife. This known
data is fed to the machine, which analyzes and learns the association of these
images based on its features such as shape, size, sharpness, etc. Now when a new

Spring 2022-2023
image is fed to the machine without any label, the machine is able to predict
accurately that it is a spoon with the help of the past data.
‫ يتم تغذية‬."‫تسميات مثل "ملعقة" أو "سكين‬
ّ ّ ‫ لدينا صور تحتوي على‬،‫في الحالة السابقة‬
ً ‫هذه ال بيانات املعروف ة إل ى الجهاز الذي يحل ل ويتعل م االرتباط بي ن هذه الص ور‬
‫بناء عل ى‬
‫ عندم ا يت م إدخال ص ورة جديدة‬،‫ واآلن‬.‫والحدة وغيرها‬ّ ‫خص ائصها مث ل الشك ل والحج م‬
‫ يكون الجهاز قاد ًرا عل ى التنب ؤ بدق ة بأنه ا "ملعق ة" بمس اعدة‬،‫للجهاز بدون أ ي تس مية‬
.‫البيانات السابقة‬

Computer Science and IT | College of Computing | 10


Supervised learning can be further divided into two
types:

1. Classification
2. Regression

Spring 2022-2023
Computer Science and IT | College of Computing | 11
1. Classification - Supervised Learning

Classification is used when the output variable is categorical i.e. with 2 or more

Spring 2022-2023
classes. For example, yes or no, male or female, true or false, etc.
ً ‫يستخدم التصنيف عندما يكون متغير املخرجات‬
‫ ذكر أم‬، ‫ نعم أم ال‬، ‫ على سبيل املثال‬.‫ أي مع فئتين أو أكثر‬، ‫فئويا‬
‫ إلخ‬، ‫ صح أم خطأ‬، ‫أنثى‬.

Computer Science and IT | College of Computing | 12


1. Classification - Supervised Learning…..

Spring 2022-2023
Computer Science and IT | College of Computing | 13
‫‪1. Classification - Supervised Learning…..‬‬

‫‪In order to predict whether a mail is spam or not, we need to first teach the‬‬
‫‪machine what a spam mail is. This is done based on a lot of spam filters - reviewing‬‬
‫‪the content of the mail, reviewing the mail header, and then searching if it contains‬‬

‫‪Spring 2022-2023‬‬
‫‪any false information. Certain keywords and blacklist filters that blackmails are‬‬
‫‪used from already blacklisted spammers.‬‬
‫‪ ،‬لتنبؤ ما إذا كان بريد إلكتروني هو رسالة إعالنية غير مرغوبة أو ال‪ ،‬نحتاج في البداية إلى‬
‫تعليم اآللة عن ما هي رسائل اإلعالنات الغير مرغوبة‪ .‬ويتم ذلك عن طريق استخدام العديد‬
‫من مرشحات البريد العشوائي (السبام)‪ ،‬حيث تتم مراجعة محتوى البريد اإللكتروني ورأس‬
‫الرسالة‪ ،‬والبحث عن أي معلومات زائفة أو خداعية فيه‪ .‬وتستخدم بعض الكلمات‬
‫الرئيسية ومرشحات القائمة السوداء التي تستهدف املرسلين الرئيسيين املوجودين في‬
‫القائمة السوداء املسبقة‪ .‬وعن طريق تحليل وتعلم اآللة من هذه البيانات‪ ،‬يمكننا تدريب‬
‫الخوارز مية على التعرف على الرسائل اإلعالنية الغير مرغوبة ومن ثم تصنيفها كذلك‪.‬‬

‫| ‪Computer Science and IT | College of Computing‬‬ ‫‪14‬‬


1. Classification - Supervised Learning…..

All of these features are used to score the mail and give it a spam score. The lower
the total spam score of the email, the more likely that it is not a scam.
Based on the content, label, and the spam score of the new incoming mail, the

Spring 2022-2023
algorithm decides whether it should land in the inbox or spam folder.

‫ وكلما‬.‫تستخدم جميع هذه امليزات لتقييم البريد اإللكتروني وتسنده اًلدرجة إجمالية للسبام‬
‫ كلما كان أكثر احتما أنه ليس رسالة إعالنية‬،‫كانت درجة السبام أقل للبريد اإللكتروني‬
‫غير مرغوبة‬.
‫ تقوم‬،‫وبناء على املحتوى والتصنيف ودرجة السبام للبريد اإللكتروني الجديد الوارد‬ ً
‫الخوارزمية بتحديد ما إذا كان يجب وضعه في البريد الوارد أم في مجلد الرسائل‬
)‫اإلعالنية غير املرغوبة (السبام‬.

Computer Science and IT | College of Computing | 15


2. Regression - Supervised Learning

Regression is used when the output variable is a real or continuous value. In this
case, there is a relationship between two or more variables i.e., a change in one
variable is associated with a change in the other variable. For example, salary

Spring 2022-2023
based on work experience or weight based on height, etc.
ُ
.‫عندما يكون متغير الناتج قيمة حقيقية أو مستمرة‬ ‫تستخدم‬
‫ أي أن تغيير في متغير واحد يرتبط‬،‫ يوجد عالقة بين متغيرين أو أكثر‬،‫في هذه الحالة‬
ً ‫بناء على سنوات الخبرة أو الوزن‬
‫بناء على‬ ً ‫ الراتب‬،‫ وعلى سبيل املثال‬.‫بتغيير في املتغير اآلخر‬
.‫ وما إلى ذلك‬،‫الطول‬

Computer Science and IT | College of Computing | 16


2. Regression - Supervised Learning……

• Let’s consider two variables - humidity and temperature. Here, ‘temperature’ is


the independent variable and ‘humidity' is the dependent variable. If the
temperature increases, then the humidity decreases.

Spring 2022-2023
• These two variables are fed to the model and the machine learns the relationship
between them. After the machine is trained, it can easily predict the humidity
based on the given temperature.
ُ
‫ تعد "درجة‬،‫ هنا‬."‫• دعونا نفترض وجود متغيرين هما "رطوبة الهواء" و "درجة الحرارة‬
‫ فإن‬،‫ إذا زادت درجة الحرارة‬.‫الحرارة" املتغير املستقل و "رطوبة الهواء" املتغير املعتمد‬
.‫الرطوبة تنخفض‬
‫ بعد‬.‫ ويتعلم الجهاز الحاسوبي العالقة بينهما‬،‫• يتم إدخال هذين املتغيرين إلى النموذج‬
ً ‫ يمكنه التنبؤ بسهولة بقيم رطوبة الهواء‬،‫تدريب الجهاز‬
.‫بناء على درجة الحرارة املعطاة‬

Computer Science and IT | College of Computing | 17


2. Regression - Supervised Learning……

Spring 2022-2023
Computer Science and IT | College of Computing | 18
Real-Life Applications of Supervised Learning
• Risk Assessment
Supervised learning is used to assess the risk in financial services or insurance domains in order to
minimize the risk portfolio of the companies. 
• Image Classification
Image classification is one of the key use cases of demonstrating supervised machine learning. For

Spring 2022-2023
example, Facebook can recognize your friend in a picture from an album of tagged photos.

‫تقييم املخاطر‬:
‫تستخدم التعلم اإلشرافي لتقييم املخاطر في الخدمات املالية أو مجاالت التأمين من أجل تقليل محفظة املخاطر للشركات‬.
‫تصنيف الصور‬:
ً ‫يعد تصنيف الصور‬
‫ يمكن لـ‬،‫ على سبيل املثال‬.‫واحد ا من الحاالت االستخدام الرئيسية التي توضح التعلم اآللي اإلشرافي‬
Facebook ‫التعرف على صديقك في صورة من ألبوم الصور املوسومة‬.

Computer Science and IT | College of Computing | 19


Real-Life Applications of Supervised Learning….

• Fraud Detection
To identify whether the transactions made by the user are authentic or not. 
• Visual Recognition

Spring 2022-2023
The ability of a machine learning model to identify objects, places, people, actions,
and images.
‫تحديد االحتيال‬:
‫يتم استخدام التعلم اآللي اإلشرافي لتحديد ما إذا كانت املعامالت التي يقوم بها املستخدم‬
‫حقيقية أو ال‬.
‫التعرف املرئي‬:
‫هو قدرة نموذج التعلم اآللي على تحديد الكائنات واألماكن واألشخاص واإلجراءات والصور‬.

Computer Science and IT | College of Computing | 20


What is Unsupervised Learning?

In Unsupervised Learning, the machine uses unlabeled data and learns on itself without
any supervision. The machine tries to find a pattern in the unlabeled data and gives a
response.
ّ

Spring 2022-2023
‫ يقوم الجهاز باستخدام البيانات غير املوسومة ويتعلم بمفرده‬،‫في التعلم غير املشرف‬
‫ يحاول الجهاز العثور على نمط في البيانات غير املوسومة وإعطاء رد‬.‫دون أي إشراف‬
‫فعل‬.

Computer Science and IT | College of Computing | 21


‫‪What is Unsupervised Learning?............‬‬

‫‪Let's take a similar example is before, but this time we‬‬


‫‪do not tell the machine whether it's a spoon or a knife.‬‬

‫‪Spring 2022-2023‬‬
‫‪The machine identifies patterns from the given set and‬‬
‫‪.groups them based on their patterns, similarities, etc‬‬
‫في التعلم غير املشرف‪ ،‬يستخدم الجهاز بيانات غير مصنفة ويتعلم من تلقاء نفسه بدون‬
‫أي إشراف‪ .‬يحاول الجهاز إيجاد نمط في البيانات غير املصنفة ويعطي استجابة‪.‬‬
‫ً‬ ‫اًل‬
‫لنأخذ مثا مشابها للسابق‪ ،‬ولكن هذه املرة ال نخبر الجهاز ما إذا كانت ملعقة أو سكين‪.‬‬
‫ً‬ ‫ً‬
‫يحدد الجهاز أنماط ا من املجموعة املعطاة ويجمعها بناء على أنماطها وتشابهاتها وما إلى‬
‫ذلك‪.‬‬

‫| ‪Computer Science and IT | College of Computing‬‬ ‫‪22‬‬


Unsupervised learning can be further grouped
into types:

1-Clustering
2-Association

Spring 2022-2023
Computer Science and IT | College of Computing | 23
Unsupervised learning can be further grouped
into types:…………..

1. Clustering - Unsupervised Learning

Spring 2022-2023
Clustering is the method of dividing the objects into
clusters that are similar between them and are
dissimilar to the objects belonging to another cluster.
For example, finding out which customers made
similar product purchases.

)Unsupervised Learning( ‫ التعلم غير المشرف عليه‬- ‫التجميع‬


‫التجميع هو طريقة لتقسيم الكائنات إلى مجموعات متشابهة بينها وغير متشابهة مع الكائنات التي تنتمي‬
.‫ البحث عن العمالء الذين قاموا بشراء منتجات مماثلة‬، ‫ على سبيل املثال‬.‫إلى مجموعة أخرى‬

Computer Science and IT | College of Computing | 24


Unsupervised learning can be further grouped
into types:…………..

• Suppose a telecom company wants to reduce its


customer churn rate by providing personalized call and
data plans. The behavior of the customers is studied

Spring 2022-2023
and the model segments the customers with similar
traits. Several strategies are adopted to minimize churn
rate and maximize profit through suitable promotions
and campaigns.
ّ
‫لنفترض أن شركة اتصاالت ترغب في تقليل معدل تخلي العمالء عن خدماتها عن طريق‬
‫ يتم دراسة سلوك العمالء ويقوم النموذج بتجزئة‬.‫توفير خطط اتصال وبيانات شخصية‬
ّ
‫ يتم اعتماد عدة استراتيجيات لتقليل معدل التخلي‬.‫العمالء حسب الخصائص املشابهة‬
‫عن الخدمة وتحقيق أقصى قدر من األرباح من خالل الترقيات والحمالت املناسبة‬.

Computer Science and IT | College of Computing | 25


Unsupervised learning can be further grouped
into types:…………..

On the right side of the image, you can see a graph where
customers are grouped. Group A customers use more data
and also have high call durations. Group B customers are

Spring 2022-2023
heavy Internet users, while Group C customers have high
call duration. So, Group B will be given more data benefit
plants, while Group C will be given cheaper called call rate
.plans and group A will be given the benefit of both
‫ يستخدم العمالء‬.‫ يمكن رؤية رسم بياني يوضح تجميع العمالء‬،‫على الجانب األيمن من الصورة‬
‫ فه م‬B ‫ أم ا العمالء ف ي املجموع ة‬.‫ املزي د م ن ال بيانات ولديه م مدة مكاملات طويلة‬A ‫ف ي املجموع ة‬
،‫ لذل ك‬.‫ بمدة مكاملات طويلة‬C ‫ بينم ا يتمي ز العمالء ف ي املجموع ة‬،‫مس تخدمو اإلنترن ت الثقيلون‬
‫ بينما سيتم تقديم خطط أسعار أرخص‬،B ‫سيتم تقديم مزايا تخصصية للبيانات للمجموعة‬
.A ‫ وسيتم تقديم فائدة االثنين للمجموعة‬،C ‫للمكاملات للمجموعة‬

Computer Science and IT | College of Computing | 26


Unsupervised learning can be further grouped
into types:…………..

Spring 2022-2023
Computer Science and IT | College of Computing | 27
2. Association - Unsupervised Learning
Association is a rule-based machine learning to discover
the probability of the co-occurrence of items in a
collection. For example, finding out which products were
purchased together.

Spring 2022-2023
‫) هو تقنية يستخدمها التعلم اآللي للكشف عن احتمال‬Association( ‫التعرف على االرتباط‬
‫ يمك ن‬،‫ عل ى س بيل املثال‬.‫حدوث ارتباط بي ن عناص ر معين ة ف ي مجموع ة م ن العناص ر‬
ً ‫استخدام التعرف على االرتباط ملعرفة السلع التي تم شراؤها‬
.‫معا‬

Computer Science and IT | College of Computing | 28


2. Association - Unsupervised Learning…..
Let’s say that a customer goes to a supermarket and
buys bread, milk, fruits, and wheat. Another customer
comes and buys bread, milk, rice, and butter. Now, when

Spring 2022-2023
another customer comes, it is highly likely that if he buys
bread, he will buy milk too. Hence, a relationship is
established based on customer behavior and
recommendations are made. 
‫لنفترض أن الزبون يذهب إلى السوبرماركت ويشتري الخبز والحليب والفواكه‬
‫ عندما‬،‫ اآلن‬.‫ ويأتي زبون آخر ويشتري الخبز والحليب واألرز والزبدة‬.‫والقمح‬
ً ‫ فسيشتري الحليب أي‬،‫ فمن المرجح ج ًدا أنه إذا اشترى الخبز‬،‫يأتي زبون آخر‬
.‫ضا‬
‫ يتم إنشاء عالقة بنا ًء على سلوك العمالء ويتم عمل توصيات‬،‫وبالتالي‬.

Computer Science and IT | College of Computing | 29

You might also like