Enlitic research pipelines may need a simple baseline that maps a numeric feature to a continuous measurement. Implement ordinary least-squares linear regression for one feature.
Write fit_linear_regression(xs, ys) to return [slope, intercept] for the line y = slope * x + intercept that minimizes the sum of squared residuals across paired observations.
xs: list of n integer or float feature values.ys: list of n integer or float target values, where ys[i] corresponds to xs[i].[slope, intercept] of floats.Use the centered least-squares equations:
m = sum((x - mean_x) * (y - mean_y)) / sum((x - mean_x)^2)
and b = mean_y - m * mean_x.
def fit_linear_regression(xs, ys):