Lonnie Data

· Example

A first look at linear regression

Example tutorial with a code block and math. Replace this with your own notes.

This sample shows how a tutorial is written. Replace content/tutorials/linear-regression.mdx with a real lesson.

A simple line is

y^=β0+β1x\hat{y} = \beta_0 + \beta_1 x

and the slope on its own is β1\beta_1.

def predict(x, intercept, slope):
    return intercept + slope * x

Squared error for one point is (y−y^)2(y - \hat{y})^2. That is enough to confirm code fences and LaTeX both render.