I do not know how to check sparsity for the given matrix. This part of the code was from the past basically. I have changed some parts of this method to make the parametes of the class more adaptable with the dense_design_matrix and get rid of the parts that were unnecessary, but my ticket was not targetted on this.