Muller Unlimited

View Original

May 22, 2020

LINEAR REGRESSION

  1. A line is determined by its slope and its intercept.

    1. For each point (y) on a line, y =mx+b

      1. Where (m) is the slope

      2. (b) is the intercept

      3. (y) is a given point on the y-axis

      4. (x) is a given point on the x-axis

  2. The slope is a measure of how steep the line is.

  3. The intercept is a measure of where the line hits the y-axis.

    1. y = [m * month + b for month in months]

    2. plt.plot(months, y, “o”)

    3. plt.show( )

  4. LOSS

    1. For each data point, we calculate loss, a number that measures how bad the model’s prediction was. This is sometimes called error.

    2. We can think about loss as the squared distance from the point to the line. We use squared distance so that the points above and below the line both contribute to the total loss in the same way.