Coefficient

noun

say it: “koh-uh-FISH-unt” /ˌkoʊəˈfɪʃənt/

In a formula, a number that multiplies a quantity; in a linear model, how much the guess changes for each one-unit increase in a feature.

What is a coefficient in a linear model?

A coefficient is the number a linear model learns for one feature: how much the guess changes for one more unit of that feature, with the other features held the same. scikit-learn keeps them in coef_, in the order of the columns.

from sklearn.linear_model import LinearRegression
homes = [[1000, 1], [1500, 3], [2000, 2], [1200, 2]]   # square feet, bedrooms
prices = [250_000, 345_000, 400_000, 290_000]
model = LinearRegression().fit(homes, prices)
print(model.coef_.round())   # [  137. 13249.]: $137 a square foot, $13,249 a bedroom

In a sentence

  • “A negative coefficient for distance meant homes farther from town were guessed lower.”
  • “The size coefficient said each extra square foot added about $137 to the guess.”

Level: Journeyman · More AI Basics terms at this level

Updated