All problems

Turning a Probability Into a Class

easyPythonLogistic Regression

A probability is not a decision, and Kestrel Freight's dispatchers need a decision: either the customer gets a warning call about a late delivery or they do not. The depot draws the line with a threshold. Half is the obvious place to put it, but it is not the only one — when the calls were annoying customers the depot raised the line so that only the strongest cases triggered one, and during a bad week it dropped the line to catch more. So the threshold arrives with the probability rather than being fixed in the code, and a job sitting exactly on the line counts as a warning: the depot would rather make the call than miss the case.

Task: Print the decision for this job.

Input

One line holding two numbers separated by a single space: the model's probability for the job, between 0 and 1, and the threshold in use.

Output

One line holding 1 if the job should trigger a warning and 0 if it should not. A probability exactly equal to the threshold triggers the warning. Print the digit alone — not True, not yes.

Example:

Input:
0.7 0.5

Output:
1

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

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…