Tensor by Tensor

02.13 · UNIT 04 · Supervised learning and reliable experiments · Lab

From logistic regression to nonlinear MLPs

Logistic regression turns one score into class probabilities. An MLP adds nonlinear layers.

PLAIN-LANGUAGE INTRODUCTION

The idea

Logistic regression turns one score into class probabilities. An MLP adds nonlinear layers.

A worked example

A score of 1 becomes positive probability 0.731. The negative probability is 0.269.

The input

Numeric features, such as positive-word count 2 and negative-word count 1.

The result

A probability for each class.

Why you use it

Probabilities support classification. Nonlinear layers can learn curved decision boundaries.

A limit to remember

A probability is not proof that the class is correct.

Check your understanding

  1. A linear classifier makes a score. Suppose the chosen weights turn features [2,1] into score 1.
  2. The sigmoid function maps that score to 1/(1+e⁻¹) = 0.731.
  3. So the positive class gets 0.731. The negative class gets 1−0.731 = 0.269.
  4. A multilayer perceptron (MLP) adds hidden layers and nonlinear activation functions.
  5. Common mistake: raw scores are not probabilities. Apply the correct output rule or loss.
Open the detailed notes ↗