August 2018
Intermediate to advanced
522 pages
12h 45m
English
For our purposes, we need to create a dummy dataset of users and products (but it's very easy to employ real datasets):
import numpy as npnb_users = 1000users = np.zeros(shape=(nb_users, 4))for i in range(nb_users): users[i, 0] = np.random.randint(0, 4) users[i, 1] = np.random.randint(0, 2) users[i, 2] = np.random.randint(0, 5) users[i, 3] = np.random.randint(0, 5)
We assume that we have 1000 users with 4 features, represented by integer numbers bounded between 0 and 4 or 5. It doesn't matter what they mean; their role is to characterize a user and to allow for the clustering of the set. Of course, the features must be consistent with the task. In other words, we are assuming that the distances ...
Read now
Unlock full access