Regression and AI in practice
הוצג
13:04
מהי בינה מלאכותית
אף אחד לעולם לא כתב את החוקים להבחנה בין חתול לכלב. אף מתכנת לא ישב והקליד "אם יש לו אוזניים מחודדות וזקניים". עם זאת, הטלפון שלך עושה זאת…
קריינות באנגלית · כתוביות באנגלית ובסינית 中文 שאפשר להחליף ביניהן
בשיעור הזה
| English | משמעות |
|---|---|
| model/ˈmɒdl/ | A simplified representation of a system used to explain, analyse or predict its behaviour. |
| supervised learning/ˈsuːpəvaɪzd ˈlɜːnɪŋ/ | A way of training a model using data with correct labels. |
| regression/rɪˈɡreʃn/ | ריגרסיה |
| classification/ˌklæsɪfɪˈkeɪʃn/ | סיווג |
| linear regression/ˈlɪnɪə rɪˈɡreʃn/ | רגרסיה ליניארית |
| pipeline/ˈpaɪplaɪn/ | An arrangement that overlaps stages of different instructions or tasks to improve overall throughput. |
| category/ˈkætɪɡəri/ | A group or class that an item can be assigned to. |
| labelled examples | Training examples that include both input data and the correct answers. |
| label/ˈleɪbl/ | A symbolic name identifying an item; in assembly language, a name associated with an instruction or storage address. |
| classifier | A model that predicts which category an input belongs to. |
| regressor | A model that predicts a number on a continuous scale. |
| loss functions | Methods for measuring how wrong a model's predictions are. |
| coefficients/ˌkəʊɪˈfɪʃənts/ | Numerical or constant factors multiplying terms in an expression. |
| sum of the squared errors | The total found by squaring each prediction error and adding the results. |
| training/ˈtreɪnɪŋ/ | The process of adjusting a network's weights and biases using data. |
| polynomial regression | A method that predicts numbers using powers of inputs to model curved relationships. |
| decision tree/dɪˈsɪʒn triː/ | A model that makes predictions by following a series of decisions. |
| neural network | A model made of connected units arranged in layers that learn patterns from data. |
| loss/lɒs/ | A measure of how wrong a model's predictions are. |
| gradient descent/ˈɡreɪdɪənt dɪˈsent/ | An iterative method that adjusts parameters in the direction opposite the gradient to seek a smaller value of an objective function. |
| Face identification | The process of finding a person's identity by comparing their face with known faces. |
| image recognition/ˈɪmɪdʒ ˌrekəɡˈnɪʃn/ | Computer processing that identifies or classifies objects, patterns or other features in images. |
| OCR/ˌəʊ siː ˈɑː/ | זיהוי דמויות אופטיות |
| pixels/ˈpɪkslz/ | An individual picture element in a digital image or display. |
| machine translation/məˈʃiːn trænˈsleɪʃn/ | Automatic conversion of text or speech from one human language into another. |
| text-to-speech/tekst tə spiːtʃ/ | Technology that changes written text into spoken audio. |
| inference/ˈɪnfərəns/ | The use of a trained model to make a prediction from new input. |
| forward and backward passes | Steps that produce a prediction, then work backwards to guide changes to weights. |
| labelled dataset | A collection of data examples with their correct answers included. |
| weights | Numbers that control how strongly inputs affect a network's outputs. |
| epochs/ˈiːpɒks/ | Complete passes through the training dataset, with each pass potentially divided into smaller batches. |
| network/ˈnetwɜːk/ | A set of connected devices or nodes that can exchange information. |
| activate | To apply a function to a network unit's input to produce its output. |
| layer/ˈleɪə/ | A group of units in a neural network at the same stage of processing. |
חיזוי מספר, לא שם
- שאלו לדגם "האם דוא"ל זה ספאם?" ועליו לבחור מתוך סט קבוע של תשובות. שאלו אותו "כמה הבית יימכר ב-?" ואין סט לבחור ממנו: התשובה היא מספר, וטייה של אלף לירה היא כמעט נכון.
- אלו שתי משימות נפרדות, והבלבול ביניהן הוא הטעות הנפוצה ביותר בנושא זה. שתיהן הן למידה מופקחת; ההבדל היחיד הוא בצורת התשובה.
- שיעור זה עוסק בריגרסיה לעומת מיון, כיצד ריגרסיה ליניארית בוחרת את הקו שלה, וכיצד מוצרים אמיתיים מקשרים מודלים מאומנים לפינות תהליך.
ריגרסיה ומיון
- מיון (Classification) מתחזה קטגוריה מתוך סט קבוע: חתול או כלב, דוא"ל זבל או לא, איזה מתוך עשרת הספרות.
- ריגרסיה (Regression) מתחזה מספר בקנה מידה רציף: מחיר בית, טמפרטורה של מחר, כמה יעלה הזמן לנסיעה.
- שתיהן מופקחות: שתיהן לומדות מדוגמיות מסומנות. הבחירה ביניהן נקבעת על ידי שאלה אחת: האם התשובה היא תווית או מספר?
- ההבחנה משנה את צורה המדידה להצלחה. במיון התוצאה נכונה או שגויה; בריגרסיה ישנו סטייה מסוימת, ולכן פונקציות האובדן שלהן שונות.

The difference between regression and classification is that regression predicts:
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
Regression outputs a continuous number (price, temperature); classification outputs a category.
Regression predicts a continuous number (a price, a temperature), while classification predicts a category (cat vs dog).
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
Number out = regression; category out = classification — the two main kinds of supervised prediction.
דוגמה מפורטת: איזו משימה ואיזו
- חיזוי לאיזו מתוך חמישה סוגי לקוחות קונה שייך. מיון: התשובה היא אחת מהסט הקבוע של קטגוריות.
- חיזוי כמה הקונה הזה י spending בחודש הבא. ריגרסיה: התשובה היא מספר, וקירוב נחשב כמעט נכון.
- חיזוי האם מכונה תיקרע בשבוע הבא. מיון: כן או לא. חיזוי לכמה ימים עד שהמכונה תקרע. ריגרסיה.
- אותם נתונים בסיסיים יכולים לשמש לכל אחד מהם. קרא את השאלה שנשאלת, ולא את נושא העסק.
Match each prediction task to its kind.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
The same data can feed either. Read the question: a label from a fixed set, or a number on a scale.
ריגרסיה ליניארית
- ריגרסיה ליניארית מושיקה קו ישר, או משטח שטוח כאשר ישנם מספר קלטות:
- המקדם (הביטויים) נבחרים כדי למזער את סכום השגיאות הריבועיות בין החיזויים של הקו לערכי האימון בפועל.
- ריבוע, לשתי סיבות שהבחינה מקבלת: שגיאות מעל ומתחת לקו לא יכולות לבטל זו את זו, ושגיאה גדולה עונשת הרבה יותר ממספר שגיאות קטנות.

הקו שמשאיר את סכום המרחק הריבועי הקטן ביותר

Fitting a regression line
Drag the controls. Linear regression draws the straight line that makes the squared distances to the data points as small as possible — then it predicts a number for any new input.
Linear regression chooses its coefficients to:
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
It fits the line/hyperplane that makes the squared differences from the data points as small as possible.
Why does linear regression minimise the sum of the SQUARED errors rather than the errors themselves?
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
Both reasons are accepted. Without squaring, a line could have a huge error above and below and still score zero.
מתי קו ישר הוא המודל המתאים
- השתמש בריגרסיה ליניארית כאשר הקשר נראה ליניארי בקירוב ואתה רוצה מודל שאדם יכול לקרוא: כל מקדם אומר כמה הכניסה הזו חשובה, ובאיזה כיוון.
- כאשר המידע מתעקם, אותה עיקרון נשאר תקף עם מודל אחר: רגרסיה פולינומית, עץ החלטות או רשת עצבית. בכל מקרה התבנית זהה: בחרו מודל, הגדירו פונקציית איבוד, מינימוזו אותה.
- תבנית זו היא מה שמחבר את שיעור זה לקודם: ירידת מעריכה היא פשוט הדרך שבה מבוצעת המינימיזציה כאשר אין נוסחה לתשובה.

בינה מלאכותית במוצר אמיתי
- מערכות אמיתיות נדירות שמשתמשות במודל אחד. הן מקשרות מספר מודלים מאומנים ל-מערכת (פייפליין), כאשר כל אחד מבצע שלב אחד.
- זיהוי פנים בדלת: מצלמה צולמת פנים, זיהוי תמונות ממיר אותו לייגום מספרי, והוא מושווה לייגומים של אנשים רשומים.
- קריאת שלט בקול לעובר: זיהוי תמונות מזהה את הטקסט, OCR ממיר את הפיקסלים לאותיות, תרגום מכונה ממיר את המילים, ו-טקסט-לקול מייצר את האודיו.
- המבחן נותן סצנה ושואה אילו מודלים משמשים, בסדר. ציינו את השלב ומה הוא מייצר לשלב הבא.

Match each AI idea to what it means.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Training fits the model once; inference is the quick prediction each time a user interacts.
A "read a sign aloud" feature typically chains which models?
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
Several trained models form a pipeline: find the text, extract characters, translate, then speak.
Put the stages of an app that reads a foreign sign aloud in order.
רמת קושי 3/5 · 200 מטבעות + בונוס קטן בהשלמה הראשונה היום
Several trained models chained together, each handing its output to the next. Name the stage and what it produces.
דוגמה פתורה: אימון לעומת היסק
- אפליקציה בטלפון מזהה צמח מתמונה מיידית, אך אימון המודל שלה קח שבועות על מכונות רבות. הסבירו מדוע.
- אימון מריץ חוזר ושוב מעברים קדימה ואחורה על מאגר נתונים תווית גדול מאוד, ומכוון מיליוני משקלים לאורך מספר רב של אפוקות. זה מה שלקח שבועות.
- היסק, שימוש במודל המאומן, הוא מעבר קדימה אחד ברשת שבה המשקלים קבועים כעת: כפלו, הוסיפו, הפעילו, שכבה אחר שכבה, פעם אחת.
- הבינה נמצאת ב-משקלים שנלמדו, ולכן המודל המוגמר קטן ומהיר מספיק כדי להישלח על טלפון.

Using a trained model to make a prediction requires only a single ____ pass.
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
Training repeats forward and backward passes over a huge dataset; inference runs the fixed weights once, which is why it is instant.
סימונים נופלים מהיד
- מיון נותן קטגוריה, רגרסיה נותנת מספר. שניהם מופקחים; זה לא ההבדל.
- רגרסיה ליניארית מינימיזת את סכום השגיאות הריבועיות, לא "המרחק הכולל". אמרו ריבוע, והסבירו מדוע.
- תשובה למערכת חייבת לתת את השלבים בסדר ולומר מה כל אחד נותן לבא.
- אימון הוא מעברים קדימה ואחורה חוזרים; היסק הוא מעבר קדימה אחד. אל תתארו אימון כאשר השאלה שואלת על שימוש.
הבנתך מושלמת
- מיון חוזה קטגוריה, רגרסיה חוזה מספר; שניהם מופקחים, ועיצוב התשובה בשאלה קובע איזה
- רגרסיה ליניארית מתאימה $y = m_1x_1 + \ldots + c$ על ידי מינימיזציה של סכום השגיאות הריבועיות, כך ששגיאות לא יכולות לבטל זו את זו וגדולות מועדות בחומרה
- מידע מעוקם צריך מודל אחר, אבל התבנית לא השתנתה: בחרו מודל, הגדירו איבוד, מינימוזו אותו
- מוצרים אמיתיים מקשרים מודלים: זיהוי תמונה, OCR, תרגום וטקסט-לקול; אימון הוא הרבה מעברים קדימה ואחורה, הסק הוא מעבר קדימה אחד
מה השתבש? רק צוות האתר רואה זאת.
Try it in the lab 32
All labs →- Teach a Perceptron
- Train a Network on Your Drawings
- Teach a Robot by Reward
- Build a Decision Tree
- Nearest Neighbours
- Roll Down the Loss
- Find the Groups
- Find the Shortest Route
- See Like a Computer
- Guess the Next Word
- Is the Computer Fair?
- Build an Expert System
- Evolve a Catapult
- Catch the Spam
- Think Ahead
- Inside a Neural Network
- Learning or Remembering? Overfitting
- Search the Maze
- What Should I Watch? A Recommender
- Teach a Car to Drive
- Matchbox Learner
- Build a Chatbot
- Fewer Colours
- Mood Meter
- Spot the Fraud
- Hear the Word
- Follow the Ants
- Plan the Delivery Round
- Squash the Data
- Explore or Exploit? Learning by Trying
- Mark the Model
- Ask Many Models