官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 阳曲县| 东阿县| 祁门县| 湖州市| 潜江市| 利辛县| 买车| 徐州市| 军事| 嘉鱼县| 黎平县| 顺平县| 竹溪县| 宝兴县| 司法| 日土县| 勐海县| 石狮市| 双辽市| 汉寿县| 杭锦后旗| 准格尔旗| 微博| 云浮市| 平顶山市| 正安县| 淮北市| 邹城市| 庐江县| 石门县| 泾源县| 太湖县| 宝鸡市| 浪卡子县| 永宁县| 嘉祥县| 内江市| 石阡县| 莫力| 绥芬河市| 类乌齐县|