- Learning Data Mining with Python(Second Edition)
- Robert Layton
- 304字
- 2021-07-02 23:40:12
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.
- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- 控糖控脂健康餐
- OpenCV for Secret Agents
- 深入理解Java7:核心技術與最佳實踐
- Java Web程序設計
- PostgreSQL 11從入門到精通(視頻教學版)
- 重學Java設計模式
- Service Mesh實戰(zhàn):基于Linkerd和Kubernetes的微服務實踐
- Learning Hadoop 2
- 零代碼實戰(zhàn):企業(yè)級應用搭建與案例詳解
- BeagleBone Robotic Projects(Second Edition)
- Mockito Essentials
- Python面試通關寶典
- 一步一步學Spring Boot:微服務項目實戰(zhàn)(第2版)
- Getting Started with RethinkDB