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

Sparse data formats

This dataset is in a sparse format. Each row can be thought of as a cell in a large feature matrix of the type used in previous chapters, where rows are users and columns are inpidual movies. The first column would be each user's review of the first movie, the second column would be each user's review of the second movie, and so on.

There are around 1,000 users and 1,700 movies in this dataset, which means that the full matrix would be quite large (nearly 2 million entries). We may run into issues storing the whole matrix in memory and computing on it would be troublesome. However, this matrix has the property that most cells are empty, that is, there is no review for most movies for most users. There is no review of movie number 675 for user number 213 though, and not for most other combinations of user and movie.

The format given here represents the full matrix, but in a more compact way. The first row indicates that user  number 196 reviewed movie number 242, giving it a ranking of 3 (out of five) on December 4, 1997.

Any combination of user and movie that isn't in this database is assumed to not exist. This saves significant space, as opposed to storing a bunch of zeroes in memory. This type of format is called a sparse matrix format. As a rule of thumb, if you expect about 60 percent or more of your dataset to be empty or zero, a sparse format will take less space to store.

When computing on sparse matrices, the focus isn't usually on the data we don't have—comparing all of the zeroes. We usually focus on the data we have and compare those.

主站蜘蛛池模板: 吉水县| 荆门市| 宁乡县| 乐东| 长宁区| 金乡县| 昔阳县| 无棣县| 青河县| 鹤岗市| 乐安县| 托里县| 海晏县| 灵武市| 乌苏市| 巍山| 渑池县| 漯河市| 四子王旗| 乐平市| 红河县| 当雄县| 京山县| 蒲江县| 宣汉县| 山西省| 聂荣县| 温泉县| 丹寨县| 尉犁县| 平谷区| 丘北县| 丰宁| 彰化县| 白水县| 通海县| 同心县| 仁布县| 康定县| 六枝特区| 肥西县|