Linear and polynomial regression code