Machine Learning Basics

In logistic regression, z = 2x − 4 is passed through the sigmoid function σ(z) = 1 ÷ (1 + e^(−z)) and the result is output as the probability of being positive. What is the output when x = 2?

  1. A0
  2. B0.5
  3. C1
Show answer and explanation

Answer: B. 0.5

When x = 2, z = 2 × 2 − 4 = 0, so σ(0) = 1 ÷ (1 + e⁰) = 1 ÷ 2 = 0.5. The sigmoid function maps any real number to a value between 0 and 1, approaching 1 as z grows and 0 as z falls. Logistic regression treats this value as the probability of being positive and splits items into two classes with a threshold such as 0.5; despite "regression" in its name, it is a model for classification.

  • A. This is the value of z, before it is passed through the sigmoid function.
  • B. Correct. σ(0) = 1 ÷ 2 = 0.5.
  • C. This is the value approached when z is large enough; at z = 0 the output is 0.5.
Practice this topic Back to topic

Related calculators

Books on Machine Learning Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Machine Learning Basics questions

  1. A node of a decision tree holds 6 data points of class A and 4 of class B. What is the Gini impurity of this node?
  2. Which of the following correctly describes the difference between bagging (random forests and the like) and boosting in ensemble learning?
  3. The class of the 2D point (0, 0) is predicted with k-nearest neighbors. The training data consists of red points (1, 0), (3, 0) and (0, −3) and blue points (0, 2) and (−2, 1). Using Euclidean distance, which pair of predictions for k = 3 and k = 5 is correct?
  4. Which of the following describes a support vector machine (SVM)?
  5. 20% of all emails are spam. A certain word appears in 50% of spam emails and in 5% of non-spam emails. Which is closest to the probability that an email containing this word is spam?