use .full() instead of data.todense() to avoid np.matrix