Slope

noun

say it: “SLOHP” /ˈsloʊp/

How steeply a line rises or falls: how much it goes up for each step to the right.

What is the slope of a line?

The slope is how much a line's guess goes up for each one-unit step in a feature, in the label's own units, such as $150 more for each extra square foot. A negative slope means the guess goes down.

from sklearn.linear_model import LinearRegression
sizes = [[1000], [1500], [2000]]               # square feet
prices = [250_000, 325_000, 400_000]
model = LinearRegression().fit(sizes, prices)
print(round(model.coef_[0], 2))   # 150.0: $150 more per square foot

In a sentence

  • “A slope of 150 means each extra square foot adds about $150 to the guessed price.”
  • “The line's slope was negative: hotter days sold fewer hot drinks.”

Level: Apprentice · More AI Basics terms at this level

Updated