We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c055f19 commit ce24484Copy full SHA for ce24484
ch08/load_ml100k.py
@@ -6,12 +6,15 @@
6
# It is made available under the MIT License
7
8
def load():
9
-
10
'''Load ML-100k data
11
12
- Returns a sparse matrix'''
+ Returns the review matrix as a numpy array'''
13
import numpy as np
14
from scipy import sparse
+
15
+ # The input is in the form of a CSC sparse matrix, so it's a natural fit to
16
+ # load the data, but we then convert to a more traditional array before
17
+ # returning
18
data = np.loadtxt('data/ml-100k/u.data')
19
ij = data[:, :2]
20
ij -= 1 # original data is in 1-based system
0 commit comments