where F[i,j] \in {0,1} indicates whether the ith candidate has the jth feature.
// First, we need a mapping from cid -> row number
c_index = self.get_cid_map(session, candidate_set)
// Next, fit the candidate set to the existing feature space in self.feat_index
F = sparse.lil_matrix((len(candidate_set), len(self.feat_index.keys())))
for f in self.load_feats(session, candidate_set):
if self.feat_index.has_key(f.name):
F[c_index[f.candidate_id], self.feat_index[f.name]] = 1
return F.tocsr()