- Python Machine Learning By Example
- Yuxi (Hayden) Liu
- 139字
- 2021-07-02 12:41:35
Label encoding
Humans are able to deal with various types of values. Machine learning algorithms (with some exceptions) need numerical values. If we offer a string such as Ivan, unless we're using specialized software, the program won't know what to do. In this example, we're dealing with a categorical feature—names, probably. We can consider each unique value to be a label. (In this particular example, we also need to decide what to do with the case—is Ivan the same as ivan?). We can then replace each label with an integer—label encoding.
The following example shows how label encoding works:

This approach can be problematic, because the learner may conclude that there's an order. For example, Asia and North America in the preceding case differ by 4 after encoding, which is a bit counter-intuitive.
- Dreamweaver CS3+Flash CS3+Fireworks CS3創(chuàng)意網(wǎng)站構(gòu)建實(shí)例詳解
- 網(wǎng)上沖浪
- Photoshop CS4經(jīng)典380例
- Blockchain Quick Start Guide
- Hands-On Cybersecurity with Blockchain
- 80x86/Pentium微型計(jì)算機(jī)原理及應(yīng)用
- 觸控顯示技術(shù)
- Apache Superset Quick Start Guide
- Kubernetes for Developers
- 基于單片機(jī)的嵌入式工程開發(fā)詳解
- 貫通Java Web開發(fā)三劍客
- Containers in OpenStack
- Linux嵌入式系統(tǒng)開發(fā)
- FPGA/CPLD應(yīng)用技術(shù)(Verilog語言版)
- Cloud Security Automation