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

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.

主站蜘蛛池模板: 南华县| 望谟县| 抚松县| 安阳市| 苏尼特右旗| 治县。| 基隆市| 宁河县| 江源县| 广德县| 巨野县| 丹江口市| 吉林市| 平邑县| 天气| 习水县| 蚌埠市| 桐柏县| 鸡西市| 文安县| 喀喇沁旗| 登封市| 张家港市| 三亚市| 迭部县| 鄂托克旗| 博野县| 紫云| 方山县| 隆子县| 丰城市| 北票市| 广昌县| 临颍县| 达州市| 城固县| 张家界市| 牡丹江市| 禄劝| 萨迦县| 云安县|