داده های عددی واقعی را می توان به طور معناداری ضرب کرد. به عنوان مثال، مدلی را در نظر بگیرید که ارزش یک خانه را بر اساس مساحت آن پیش بینی می کند. توجه داشته باشید که یک مدل مفید برای ارزیابی قیمت مسکن معمولاً بر صدها ویژگی متکی است. با این حال، اگر همه چیز برابر باشد، یک خانه 200 متر مربعی باید تقریباً دو برابر یک خانه 100 متر مربعی ارزش داشته باشد.
اغلب، شما باید ویژگی هایی را که حاوی مقادیر صحیح هستند به عنوان داده های طبقه بندی به جای داده های عددی نشان دهید. به عنوان مثال، یک ویژگی کد پستی را در نظر بگیرید که در آن مقادیر اعداد صحیح هستند. اگر این ویژگی را بهجای طبقهبندی به صورت عددی نشان میدهید، از مدل میخواهید که یک رابطه عددی بین کدهای پستی مختلف پیدا کند. یعنی شما به مدل میگویید که کد پستی 20004 را دو برابر (یا نصف) سیگنال بزرگتر از کد پستی 10002 در نظر بگیرد. نمایش کدهای پستی به عنوان دادههای طبقهبندی به مدل اجازه میدهد هر کد پستی جداگانه را وزن کند.
رمزگذاری
رمزگذاری به معنای تبدیل داده های طبقه بندی شده یا سایر داده ها به بردارهای عددی است که یک مدل می تواند بر روی آنها آموزش دهد. این تبدیل ضروری است زیرا مدل ها فقط می توانند بر روی مقادیر ممیز شناور آموزش ببینند. مدل ها نمی توانند روی رشته هایی مانند "dog" یا "maple" تمرین کنند. این ماژول روش های مختلف رمزگذاری را برای داده های طبقه بندی توضیح می دهد.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[[["\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,["| **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\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**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)"]]