{
  "schema": "ml-prep/item@1",
  "item": {
    "id": "original-ml-logistic",
    "area": "machine-learning",
    "topic": "classification",
    "origin": "original",
    "title": "Logistic probability and cross-entropy",
    "skills": [
      "logistic-regression",
      "cross-entropy",
      "decision-boundary"
    ],
    "priority": "foundation",
    "difficulty": "easy",
    "estimated_minutes": 6,
    "prerequisites": [
      "logarithms"
    ],
    "prompt": "A binary logistic model produces logit $z=\\ln(3)$ for a positive example $y=1$. Compute $p(y=1\\mid\\mathbf{x})$, the predicted class at threshold $0.5$, and binary cross-entropy loss.\n",
    "answer": "$$\\sigma(\\ln 3)=\\frac{3}{4},$$\n\nso the predicted class is $1$, and the loss is\n\n$$-\\ln\\left(\\frac{3}{4}\\right)=\\ln\\left(\\frac{4}{3}\\right)\\approx 0.28768.$$\n",
    "check": {
      "kind": "numeric",
      "id": "original-ml-logistic",
      "values": [
        0.75,
        1,
        0.2876820724517809
      ]
    }
  }
}