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

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.

主站蜘蛛池模板: 始兴县| 高要市| 紫云| 永城市| 永登县| 高阳县| 红安县| 高要市| 普宁市| 金乡县| 陆川县| 安徽省| 太白县| 旬邑县| 洪雅县| 大足县| 遂平县| 闸北区| 岐山县| 安义县| 兴安盟| 松阳县| 凤城市| 尼勒克县| 财经| 桂平市| 射阳县| 津南区| 泰顺县| 西宁市| 镇江市| 揭东县| 阳高县| 竹溪县| 黔东| 丹阳市| 田阳县| 布尔津县| 永新县| 江口县| 河曲县|