Allow for adding modification of least squares and setting the coefficient array from python