A linear model is a model that makes predictions by combining input features with learned weights and a bias term. Such models are generally easier to train and interpret than deep nonlinear models, but they may capture fewer complex interactions unless features are engineered. Linear regression and logistic regression are common examples.
A model that assigns one weight per feature to make predictions. (Linear models also incorporate a bias.) In contrast, the relationship of features to predictions in deep models is generally nonlinear. Linear models are usually easier to train and more interpretable than deep models. However, deep models can learn complex relationships between features. Linear regression and logistic regression are two types of linear models. A linear model follows this formula: where: - y' is the raw prediction. (In certain kinds of linear models, this raw prediction will be further modified. For example, see logistic regression.) - b is the bias. - w is a weight, so w~1~ is the weight of the first feature, w~2~ is the weight of the second feature, and so on. - x is a feature, so x~1~ is the value of the first feature, x~2~ is the value of the second feature, and so on. For example, suppose a linear model for three features learns the following bias and weights: - b = 7 - w~1~ = -2.5 - w~2~ = -1.2 - w~3~ = 1.4 Therefore, given three features (x~1~, x~2~, and x~3~), the linear model uses the following equation to generate each prediction: Suppose a particular example contains the following values: - x~1~ = 4 - x~2~ = -10 - x~3~ = 5 Plugging those values into the formula yields a prediction for this example: Linear models include not only models that use only a linear equation to make predictions but also a broader set of models that use a linear equation as just one component of the formula that makes predictions. For example, logistic regression post-processes the raw prediction (y') to produce a final prediction value between 0 and 1, exclusively.