실제 숫자 데이터는 의미 있게 곱할 수 있습니다. 예를 들어 면적을 기준으로 주택의 가치를 예측하는 모델을 생각해 보겠습니다.
주택 가격을 평가하는 데 유용한 모델은 일반적으로
살펴보겠습니다 다른 모든 조건이 같으면 200제곱미터 크기의 주택이
미터는 정사각형이 100개인 동일한 집보다 약 2배 더 가치가 있어야 함
미터
종종 정수 값을 포함하는 특성을 다음과 같이 나타내야 합니다.
숫자 데이터 대신 범주형 데이터를 사용합니다. 예를 들어 우편함이
값이 정수인 코드 특성입니다. 여러분이
범주형이 아닌 숫자로 특성을 추출해야 하는 경우
숫자 관계를 찾기 위해
우편번호를 입력하세요. 즉, 모델에
우편번호 20004를 우편번호보다 두 배 (또는 절반) 큰 신호로 처리
10002입니다. 우편번호를 범주형 데이터로 표현하면 모델이
각 개별 우편번호에 별도로 가중치를 부여합니다.
인코딩
인코딩이란 범주형 데이터 또는 기타 데이터를 모델이 학습할 수 있는 숫자 벡터로 변환하는 것을 의미합니다. 이 전환이 필요한 이유는 모델이
부동 소수점 값만 학습합니다. 학습될 수 없는 문자열과
"dog" 또는 "maple" 이 모듈에서는 카테고리 데이터의 다양한 인코딩 방법을 설명합니다.
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[[["\u003cp\u003eThis module focuses on differentiating between categorical and numerical data within machine learning.\u003c/p\u003e\n"],["\u003cp\u003eYou will learn how to represent categorical data using one-hot vectors and address common issues associated with it.\u003c/p\u003e\n"],["\u003cp\u003eThe module covers encoding techniques for converting categorical data into numerical vectors suitable for model training.\u003c/p\u003e\n"],["\u003cp\u003eFeature crosses, a method for combining categorical features to capture interactions, are also discussed.\u003c/p\u003e\n"],["\u003cp\u003eIt is assumed you have prior knowledge of introductory machine learning and working with numerical data.\u003c/p\u003e\n"]]],[],null,["# Working with categorical data\n\n| **Estimated module length:** 50 minutes\n| **Learning objectives**\n|\n| - Distinguish categorical data from numerical data.\n| - Represent categorical data with one-hot vectors.\n| - Address common issues with categorical data.\n| - Create feature crosses.\n| **Prerequisites:**\n|\n| This module assumes you are familiar with the concepts covered in the\n| following modules:\n|\n| - [Introduction to Machine Learning](/machine-learning/intro-to-ml)\n| - [Working with numerical data](/machine-learning/crash-course/numerical-data)\n\n[**Categorical data**](/machine-learning/glossary#categorical-data) has a\n*specific set* of possible values. For example:\n\n- The different species of animals in a national park\n- The names of streets in a particular city\n- Whether or not an email is spam\n- The colors that house exteriors are painted\n- Binned numbers, which are described in the [Working with Numerical\n Data](/machine-learning/crash-course/numerical-data) module\n\nNumbers can also be categorical data\n------------------------------------\n\nTrue [**numerical data**](/machine-learning/glossary#numerical-data)\ncan be meaningfully multiplied. For example, consider a\nmodel that predicts the value of a house based on its area.\nNote that a useful model for evaluating house prices typically relies on\nhundreds of features. That said, all else being equal, a house of 200 square\nmeters should be roughly twice as valuable as an identical house of 100 square\nmeters.\n\nOftentimes, you should represent features that contain integer values as\ncategorical data instead of numerical data. For example, consider a postal\ncode feature in which the values are integers. If you represent this\nfeature numerically rather than categorically, you're asking the model\nto find a numeric relationship\nbetween different postal codes. That is, you're telling the model to\ntreat postal code 20004 as twice (or half) as large a signal as postal code\n10002. Representing postal codes as categorical data lets the model\nweight each individual postal code separately.\n\nEncoding\n--------\n\n**Encoding** means converting categorical or other data to numerical vectors\nthat a model can train on. This conversion is necessary because models can\nonly train on floating-point values; models can't train on strings such as\n`\"dog\"` or `\"maple\"`. This module explains different\nencoding methods for categorical data.\n| **Key terms:**\n|\n| - [Categorical data](/machine-learning/glossary#categorical-data)\n- [Numerical data](/machine-learning/glossary#numerical-data) \n[Help Center](https://support.google.com/machinelearningeducation)"]]