- Machine Learning with Swift
- Alexander Sosnovshchenko
- 202字
- 2021-06-24 18:54:50
Types of features
In the books example, you can see several types of features:
- Categorical or unordered: Title, author, genre, publisher. They are similar to enumeration without raw values in Swift, but with one difference: they have levels instead of cases. Important: you can't order them or say that one is bigger than another.
- Binary: The presence or absence of something, just true or false. In our case, the In stock feature.
- Real numbers: Page count, year, average reader's review score. These can be represented as float or double.
There are others, but these are by far the most common.
The most common ML algorithms require the dataset to consist of a number of samples, where each sample is represented by a vector of real numbers (feature vector), and all samples have the same number of features. The simplest (but not the best) way of translating categorical features into real numbers is by replacing them with numerical codes (Table 1.2).
Table 1.2: dummy books dataset after simple preprocessing:

This is an example of how your dataset may look before you feed it into your ML algorithm. Later, we will discuss the nuts and bolts of data preprocessing for specific applications.
推薦閱讀
- 用“芯”探核:龍芯派開(kāi)發(fā)實(shí)戰(zhàn)
- 筆記本電腦使用、維護(hù)與故障排除實(shí)戰(zhàn)
- Python GUI Programming:A Complete Reference Guide
- 現(xiàn)代辦公設(shè)備使用與維護(hù)
- 硬件產(chǎn)品經(jīng)理手冊(cè):手把手構(gòu)建智能硬件產(chǎn)品
- 嵌入式系統(tǒng)設(shè)計(jì)教程
- 從零開(kāi)始學(xué)51單片機(jī)C語(yǔ)言
- OUYA Game Development by Example
- 微服務(wù)分布式架構(gòu)基礎(chǔ)與實(shí)戰(zhàn):基于Spring Boot + Spring Cloud
- Visual Media Processing Using Matlab Beginner's Guide
- 面向?qū)ο蠓治雠c設(shè)計(jì)(第3版)(修訂版)
- SiFive 經(jīng)典RISC-V FE310微控制器原理與實(shí)踐
- 單片機(jī)技術(shù)及應(yīng)用
- Python Machine Learning Blueprints
- 單片機(jī)原理及應(yīng)用