The Sigmoid Function
Kestrel Freight's late-delivery model does not hand back a probability. It hands back a score on an unbounded scale: strongly negative when the job looks safe, strongly positive when it looks doomed, and zero when the evidence is evenly balanced. The dispatch screen cannot show that to a customer. What it needs is the standard sigmoid, the S-shaped logistic curve built on the natural exponential, which squashes any score onto the open range between 0 and 1 — never quite reaching either end, sitting at exactly one half when the score is zero, and treating a score and its negative as mirror images.
Task: Print the probability the sigmoid gives for this score.
Input
One line holding a single number, the model's score. It may be negative and it may have a decimal point.
Output
One line holding the probability rounded to 4 decimal places, with no label.
Example:
Input:
0
Output:
0.5000
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in