Unary linear regression related code