Chapter #4 - Machine Learning
Chapter #4 - Machine Learning
College of Computing
MSC 536 - Selected Topic in Artificial Intelligence
CEN 526 - Artificial Intelligence
Machine Learning
Spring 2022-2023
Dr. Mohammad Hujooj
Spring 2022-2023
• What is Unsupervised Learning?
• Real-Life Applications of Unsupervised
Learning
• Difference Between Supervised and
Unsupervised 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.
ّ ّ ّ
منخال لإدخا ال لبياناتوا ملعلوماتدو "ن،وتتصرفك ا لبشر ت علم ا آللة" هي علم يتعلق ب جع لا لح واسيبت تعلم
ا لحاجة إ لى ب رمجة ص ريحة.
ّ
تستطيع، وعندما تأتي بيانات جديدة،يتم تدريب خوارزميات تعلم اآللة باستخدام بيانات تدريبية
ً
الخوارزميات إجراء تنبؤات واتخاذ قرارات دقيقة استنادا إلى البيانات السابقة.
Spring 2022-2023
where language processing algorithms are run to understand the
user's intent. Then finally, Siri tells you the answer.
ُ
يتم تحويل الصوت، عندما تطلب من سيري فعل شيء ما،على سبيل املثال
يت م إرس ال الن ص إل ى.إل ى ن ص م ن خالل تقني ة قوي ة للتعرف عل ى الكالم
ً
حيث يتم تشغيل خوارزميات معالجة،خوادم آبل للمعالجة األكثر تفصيال
. ثم يخبرك سيري اإلجابة النهائية.اللغة لفهم نية املستخدم
Spring 2022-2023
1. Supervised Learning
2. Unsupervised Learning
Spring 2022-2023
answer.
ً ً ّ ّ ّ في التعلم
يتعلم الجهاز بإشراف ويتضمن نموذجا قادرا على التنبؤ،املوجه
وتعرف املجموعات التي.بمساعدة مجموعة بيانات تحتوي على تسميات
يعني هذا أنه."تحتوي على تسميات سابقة بـ "مجموعات البيانات املسماة
ً تعرف اإلجابة املستهدفة مسبقا،في مجموعات البيانات املسماة.
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.
يتم تغذية."تسميات مثل "ملعقة" أو "سكين
ّ ّ لدينا صور تحتوي على،في الحالة السابقة
ً هذه ال بيانات املعروف ة إل ى الجهاز الذي يحل ل ويتعل م االرتباط بي ن هذه الص ور
بناء عل ى
عندم ا يت م إدخال ص ورة جديدة، واآلن.والحدة وغيرهاّ خص ائصها مث ل الشك ل والحج م
يكون الجهاز قاد ًرا عل ى التنب ؤ بدق ة بأنه ا "ملعق ة" بمس اعدة،للجهاز بدون أ ي تس مية
.البيانات السابقة
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.
ً يستخدم التصنيف عندما يكون متغير املخرجات
ذكر أم، نعم أم ال، على سبيل املثال. أي مع فئتين أو أكثر، فئويا
إلخ، صح أم خطأ، أنثى.
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.
،لتنبؤ ما إذا كان بريد إلكتروني هو رسالة إعالنية غير مرغوبة أو ال ،نحتاج في البداية إلى
تعليم اآللة عن ما هي رسائل اإلعالنات الغير مرغوبة .ويتم ذلك عن طريق استخدام العديد
من مرشحات البريد العشوائي (السبام) ،حيث تتم مراجعة محتوى البريد اإللكتروني ورأس
الرسالة ،والبحث عن أي معلومات زائفة أو خداعية فيه .وتستخدم بعض الكلمات
الرئيسية ومرشحات القائمة السوداء التي تستهدف املرسلين الرئيسيين املوجودين في
القائمة السوداء املسبقة .وعن طريق تحليل وتعلم اآللة من هذه البيانات ،يمكننا تدريب
الخوارز مية على التعرف على الرسائل اإلعالنية الغير مرغوبة ومن ثم تصنيفها كذلك.
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.
وكلما.تستخدم جميع هذه امليزات لتقييم البريد اإللكتروني وتسنده اًلدرجة إجمالية للسبام
كلما كان أكثر احتما أنه ليس رسالة إعالنية،كانت درجة السبام أقل للبريد اإللكتروني
غير مرغوبة.
تقوم،وبناء على املحتوى والتصنيف ودرجة السبام للبريد اإللكتروني الجديد الوارد ً
الخوارزمية بتحديد ما إذا كان يجب وضعه في البريد الوارد أم في مجلد الرسائل
)اإلعالنية غير املرغوبة (السبام.
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.
ُ
.عندما يكون متغير الناتج قيمة حقيقية أو مستمرة تستخدم
أي أن تغيير في متغير واحد يرتبط، يوجد عالقة بين متغيرين أو أكثر،في هذه الحالة
ً بناء على سنوات الخبرة أو الوزن
بناء على ً الراتب، وعلى سبيل املثال.بتغيير في املتغير اآلخر
. وما إلى ذلك،الطول
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.
ُ
تعد "درجة، هنا."• دعونا نفترض وجود متغيرين هما "رطوبة الهواء" و "درجة الحرارة
فإن، إذا زادت درجة الحرارة.الحرارة" املتغير املستقل و "رطوبة الهواء" املتغير املعتمد
.الرطوبة تنخفض
بعد. ويتعلم الجهاز الحاسوبي العالقة بينهما،• يتم إدخال هذين املتغيرين إلى النموذج
ً يمكنه التنبؤ بسهولة بقيم رطوبة الهواء،تدريب الجهاز
.بناء على درجة الحرارة املعطاة
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 التعرف على صديقك في صورة من ألبوم الصور املوسومة.
• 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.
تحديد االحتيال:
يتم استخدام التعلم اآللي اإلشرافي لتحديد ما إذا كانت املعامالت التي يقوم بها املستخدم
حقيقية أو ال.
التعرف املرئي:
هو قدرة نموذج التعلم اآللي على تحديد الكائنات واألماكن واألشخاص واإلجراءات والصور.
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
يقوم الجهاز باستخدام البيانات غير املوسومة ويتعلم بمفرده،في التعلم غير املشرف
يحاول الجهاز العثور على نمط في البيانات غير املوسومة وإعطاء رد.دون أي إشراف
فعل.
Spring 2022-2023
The machine identifies patterns from the given set and
.groups them based on their patterns, similarities, etc
في التعلم غير املشرف ،يستخدم الجهاز بيانات غير مصنفة ويتعلم من تلقاء نفسه بدون
أي إشراف .يحاول الجهاز إيجاد نمط في البيانات غير املصنفة ويعطي استجابة.
ً اًل
لنأخذ مثا مشابها للسابق ،ولكن هذه املرة ال نخبر الجهاز ما إذا كانت ملعقة أو سكين.
ً ً
يحدد الجهاز أنماط ا من املجموعة املعطاة ويجمعها بناء على أنماطها وتشابهاتها وما إلى
ذلك.
1-Clustering
2-Association
Spring 2022-2023
Computer Science and IT | College of Computing | 23
Unsupervised learning can be further grouped
into types:…………..
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.
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.
ّ
لنفترض أن شركة اتصاالت ترغب في تقليل معدل تخلي العمالء عن خدماتها عن طريق
يتم دراسة سلوك العمالء ويقوم النموذج بتجزئة.توفير خطط اتصال وبيانات شخصية
ّ
يتم اعتماد عدة استراتيجيات لتقليل معدل التخلي.العمالء حسب الخصائص املشابهة
عن الخدمة وتحقيق أقصى قدر من األرباح من خالل الترقيات والحمالت املناسبة.
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 للمكاملات للمجموعة
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( التعرف على االرتباط
يمك ن، عل ى س بيل املثال.حدوث ارتباط بي ن عناص ر معين ة ف ي مجموع ة م ن العناص ر
ً استخدام التعرف على االرتباط ملعرفة السلع التي تم شراؤها
.معا
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.
لنفترض أن الزبون يذهب إلى السوبرماركت ويشتري الخبز والحليب والفواكه
عندما، اآلن. ويأتي زبون آخر ويشتري الخبز والحليب واألرز والزبدة.والقمح
ً فسيشتري الحليب أي، فمن المرجح ج ًدا أنه إذا اشترى الخبز،يأتي زبون آخر
.ضا
يتم إنشاء عالقة بنا ًء على سلوك العمالء ويتم عمل توصيات،وبالتالي.