KatInterview

Confusion Matrix Rates, Sigmoid Forward Pass, and Activation Choice

Machine LearningModel answer
HardModel answerMachine Learningconfusion-matrixrocsigmoid

Last updated

Work through a screening-style ML set: pick the confusion matrix matching target TPR/FPR, hand-compute a sigmoid neuron, and justify activation choices per layer.

Three short fundamentals problems of the kind that show up in timed ML screens. Show your arithmetic.

1) Matching a target TPR and FPR

Four binary-classification confusion matrices are proposed. In each, rows are actual and columns are predicted.

OptionTPFNFPTN
A80201090
B455455
C5050595
D90103070

A model is required to hit TPR (recall) = 0.80 and FPR = 0.10 simultaneously.

Question: Which option(s) meet both targets? Briefly say what operating point each of the other options represents.

2) Forward pass of one sigmoid unit

A neuron computes

[ z = w^\top x + b, \qquad \hat{y} = \sigma(z) = \frac{1}{1+e^{-z}} ]

with (w = [0.5,,-1.0]), (x = [2.0,,1.0]), (b = 0).

Question: Compute (z) and (\hat{y}) to three decimal places, and state the value of the derivative (\sigma'(z)) at this point.

3) Choosing activations

The candidate set is sigmoid, tanh, ReLU, Leaky ReLU, softmax.

  1. Which activation belongs in the output layer for multi-class, single-label classification?
  2. Give two independent reasons ReLU-style nonlinearities are standard in hidden layers of deep nets.
  3. Name one characteristic failure of sigmoid/tanh in deep hidden layers and explain the mechanism.

Hints

Hint 1

For part 1, each rate is computed inside a single actual-class row: TPR uses the positive row, FPR uses the negative row. Never divide by the grand total.

Hint 2

For part 2, watch the sign of the second weight — the dot product largely cancels. Then use σ(0) and recall σ'(z) = σ(z)(1 − σ(z)).

Hint 3

For part 3, structure your answer as output layer / hidden layer / failure mode, and justify each with the shape of the derivative rather than a slogan.