ML0049 Logistic Regression II

Please compare Logistic Regression and Neural Networks.

Answer

Logistic regression is a straightforward, linear model suited to linearly separable data, offering good interpretability and fast, simple training. Neural networks are powerful non-linear models capable of capturing intricate patterns in large datasets, often at the expense of interpretability and higher computational demands.

(1) Expressiveness: Logistic regression draws one hyperplane; neural networks compose hidden layers into arbitrarily curved boundaries.
(2) Workflow: Logistic regression often needs manual feature engineering; neural networks learn feature representations automatically.
(3) Cost: Logistic regression trains in seconds with low overfitting risk when features are well chosen; networks need more data, compute, and regularization.

Logistic regression drawn as a neural network with an input layer feeding one sigmoid output neuron, with no hidden layer

Figure 1: Logistic regression is a neural network: an input layer plus a single output neuron with a sigmoid activation and no hidden layer, the simplest possible network, for binary classification.

Mathematical Formulation:
\hat{y} = \sigma(\mathbf{w}^{\top} \mathbf{x} + b)
\hat{y} = g\big(W_L \, f(\cdots f(W_1 \mathbf{x} + b_1) \cdots) + b_L\big)

Where:

  • The first line is logistic regression: one linear score through a sigmoid \sigma, equivalent to a 0-hidden-layer network.
  • The second line is a general neural network: compositions of weight matrices W_l, biases b_l, and non-linearities f, with output map g.
  • Setting the number of hidden layers to zero and g = \sigma recovers logistic regression exactly.
FeatureLogistic RegressionNeural Networks (NN)
Model TypeLinearNon-linear, multi-layer
ArchitectureSingle-layer (no hidden layers)Multi-layer (can be deep)
Non-linearityCan’t model non-linear relationships directlyCan capture complex non-linear patterns
Feature EngineeringOften needed manuallyLearns feature representations automatically
InterpretabilityHighLow (acts like a black box)
Training TimeFast, simple to trainSlower, needs more compute & data
Overfitting RiskLow (if features are well-chosen)Higher (requires regularization)
Common Use CasesSimple classification problems (e.g., churn prediction)Complex tasks (e.g., image, text, speech recognition)

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *