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ː ˈɑː/ | OCR(광학 문자 인식) |
| 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. |
| exit/ˈeɡzɪt/ |
이름이 아닌 숫자를 예측하기
- 모델에게 "이 메일은 스팸인가?"라고 묻고 고정된 답변 세트 중 하나를 선택하게 하세요. 반면 "이 집은 얼마에 팔릴까?"라고 물으면 선택할 수 있는 고정된 세트가 없습니다. 답은 숫자이며, 천 파운드 정도的差异은 거의 정답과 같습니다.
- 이는 두 가지 다른 작업이며, 이를 혼동하는 것이 이 주제의 가장 흔한 실수입니다. 둘 다监督 learning이지만, 답의 형태만 다릅니다.
- 이 수업은 분류(classification) 대비 회귀(regression), **선형 회귀(linear regression)**가 선을 어떻게 선정하는지, 그리고 실제 제품이 trained 모델을 파이프라인(pipeline)으로 연결하는 방법을 다룹니다.
회귀와 분류
- **분류(classification)**은 고정된 세트에서 **카테고리(category)**를 예측합니다: 고양이 또는 개, 스팸或非스팸, 열 개의 숫자 중 어느 것인지.
- **회귀(regression)**은 연속적 스케일에서 **숫자(number)**를 예측합니다: 집 가격, 내일의 기온, 여행 소요 시간 등.
- 둘 다 监督 learning입니다. 둘 다 라벨이 있는 예시로부터 학습합니다.二者之间选择由一个问题决定: 답이 라벨인지 숫자인가?
- 이 구분이 성공도를 측정하는 방식을 바꿉니다. 분류기는 맞거나 틀린 것입니다; 회귀기는 특정 거리만큼 벗어날 수 있으므로, 이들이 손실 함수(loss functions)를 다르게 사용하는 이유입니다.

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.
worked example: 어떤 작업이 어떤 작업인지 확인하기
-
- shopper가 5가지 고객 유형 중哪一种에 속하는지 예측.* 분류(classification): 답은 고정된 카테고리 중 하나입니다.
- 해 shopper가 다음 달에 얼마나 쓸지 예측. 회귀(regression): 답은 숫자이며, 근사한 값은 거의 정답으로 간주됩니다.
- 장치가 다음 주 실패할지 예측. 분류(classification): 네或否. 실패까지 몇 일 남았는지 예측. 회귀(regression).
- 동일한 underlying data가 두 작업 모두에 사용될 수 있습니다. 주제보다는 질문하는 **질문(question)**을 읽으세요.
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.
선형 회귀
- **선형 회귀(linear regression)**은 직선을 fitting하거나, 입력이 여러 개일 때는 평평한 표면을 fitting합니다:
- 계수(coefficients)는 선의 예측값과 실제 훈련 값 사이의 **제곱 오차의 합(sum of the squared errors)**을 **최소(minimise)**하도록 선택됩니다.
- 제곱(squared)하는 이유는 시험에서 인정받는 두 가지 이유 때문입니다: 위아래의 오차가 서로 상쇄되지 않으며, 큰 오차는 여러 작은 오차보다 훨씬 더 엄격히 penalty됩니다.

총 제곱 거리가 가장 적은 선
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.
직선이 적절한 모델인 경우
- 관계가 **대략적으로 선형(roughly linear)**이고 인간이 읽을 수 있는 모델을 원할 때 선형 회귀를 사용하세요: 각 계수는 해당 입력의 중요도와 방향을 나타냅니다.
- 데이터가 곡선을 그릴 때에도 동일한 원리는 다른 모델로 적용됩니다: polynomial regression, decision tree, 또는 neural network. 모든 경우에서 레시피는 동일합니다. 모델을 선택하고, 손실을 정의하고,最小化它.
- 이 레시피가 이 수업과 이전 수업을 연결하는 이유입니다: gradient descent는 답에 대한 공식이 없을 때最小化를 수행하는 방법일 뿐입니다.

실제 제품에서의 AI
- 실제 시스템은 드물게 하나의 모델만 사용합니다. 여러 trained 모델을 **파이프라인(pipeline)**으로 연결하여 각자가 한 단계씩 수행합니다.
- 출입문 얼굴 식별(face identification): 카메라가 얼굴을 캡처하고, 이미지 인식이 이를 수치적 표현으로 변환하며, đó는 등록된 사람들의 표현과 매칭됩니다.
- 여행자에게 표지판을 읽음: 이미지 인식이 텍스트를 위치시키고, OCR이 픽셀을 문자로 변환하며, 기계 번역이 단어를 변환하고, **텍스트-투스피치(text-to-speech)**가 오디오를 생성합니다.
- 시험은 시나리오를 제시하고 어떤 모델이 사용되었는지 순서대로 묻습니다. 단계를 명시하고 다음 단계에 대한 산출물을 설명하세요.

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.
worked example: 훈련(inference) 대비 학습(training)
- 전화 앱이 사진에서 식물을 즉시 인식하지만, 모델 훈련에는 여러 기계에서 수주가 걸렸습니다. 그 이유를 설명하세요.
- **훈련(training)**은 매우 큰 라벨이 있는 데이터셋을 반복적으로 전방 및 후방_pass에 통과시키며, 여러 에포크에 걸쳐数百万의 가중치를 조정합니다. 이것이 수주가 걸린 이유입니다.
- 추론은 학습된 모델을 사용하여 가중치가 고정된 네트워크를 **단일 전파(interior forward pass)**로 처리하는 과정입니다: 곱하기, 더하기, 활성화 단계를 한 번만 층별로 수행합니다.
- 지능은 학습된 가중치에 reside하므로, 완성된 모델은 크기가 작고 속도가 빨라 휴대폰에 탑재할 수 있습니다.

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.
놓칠 수 있는 점
- 분류는 범위를, 회귀는 숫자를 제공합니다. 둘 다 superviszed(지시형)이므로 이것이 차이가 아닙니다.
- 선형 회귀는 '총 거리'가 아닌 제곱 오차 합을 최소화합니다. 왜 제곱인지 말하세요.
- 파이프라인의 답은 단계들을 순서대로 제시하고 각 단계가 다음 단계에 무엇을 전달하는지 설명해야 합니다.
- 학습은 반복되는 전파 및 후방 전파입니다. 추론은 단일 전파입니다. 질문이 사용에 대해 묻고 있을 때 학습을 설명하지 마십시오.
이해했습니다
- 분류는 범위를 예측하고, 회귀는 숫자를 예측합니다. 둘 다 superviszed이며, 질문의 답 형식이 어떤 것을 결정합니다.
- 선형 회귀는 $y = m_1x_1 + \ldots + c$을 제곱 오차 합의 최소화를 통해 fitting(적합)하므로, 오차가 상쇄되지 않고 큰 오차는 엄격하게 처벌됩니다.
- 곡선 데이터는 다른 모델이 필요하지만 레시피는 변함없습니다: 모델을 선하고, 손실 함수를 정의하며, 이를 최소화하십시오.
- 실제 제품은 모델을 연결합니다: 이미지 인식, 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