Binary Class Probability Calculator

Estimate class probability using logits, odds, or features. Compare thresholds and measure log loss reliably. Clear exports support audits and repeatable model checks.

Probability visualization

Interactive Plotly chart updates after Calculate.
Single mode shows P(y=1) vs P(y=0). Batch mode shows a probability distribution histogram.

Calculator

Single always computes; batch uses the box below.
Temperature calibrates on the logit scale.
Applies z' = z / T.
Predict 1 when P(y=1) ≥ threshold.
If set, the calculator reports log loss.
Linear score before sigmoid.
z = b + Σ(wᵢxᵢ)
Example: 1 0.5 -1
Must match the feature count.
Odds are p/(1-p).
Converted to logit, then temperature applied.
Header: id,logit,true_label (or prob / odds). No header: id,value,type,true_label.

Example data table

Sample rows show logits with optional true labels for evaluation.

IDLogit (z)Expected P(y=1)True label
A1.2~0.76851
B-0.7~0.33180
C0.3~0.57441
D2.1~0.89091
E-1.8~0.14190
Tip: Paste this table into Batch using id,logit,true_label.

Formula used

Sigmoid probability
p = 1 / (1 + e-z)
Maps a score into the positive-class probability.
Linear score from features
z = b + Σ(wᵢ xᵢ)
Used in logistic regression and linear models.
Odds and log-odds
odds = p/(1-p), z = ln(odds)
Odds express probability as a ratio.
Temperature calibration
z' = z / T, p = σ(z')
Softens or sharpens confidence without reranking.
Log loss (optional)
L = −[y ln(p) + (1−y) ln(1−p)]
Lower values indicate better probability estimates.

How to use this calculator

  1. Select an input method: logit, features, odds, or probability.
  2. Enter temperature and a decision threshold for classification.
  3. Fill the required fields for the chosen method.
  4. Optionally set a true label to compute log loss.
  5. Paste multiple rows into Batch input to score datasets.
  6. Click Calculate to show results above the form.
  7. Use CSV and PDF downloads for reporting.

From score to probability

Binary models often output a score (logit) rather than a probability. This calculator converts that score using the sigmoid function and reports both class probabilities. For example, a logit of 1.2 maps near 0.7685, while −1.8 maps near 0.1419, matching the sample table.

Decision thresholds and operating points

A threshold turns probabilities into decisions. At 0.50, any case with P(y=1) ≥ 0.50 is predicted positive. Raising the threshold (e.g., 0.70) reduces false positives but can increase false negatives. Lowering it (e.g., 0.30) increases sensitivity and flags more positives for review. Teams often compare precision and review volume across thresholds. Use validation curves to quantify tradeoffs and document chosen threshold alongside expected false positive rate and workload.

Odds explain relative changes

Odds express probability as a ratio p/(1−p). When odds are 3, the implied probability is 0.75. Converting to log-odds uses z = ln(odds). This view is useful because additive changes in z correspond to multiplicative changes in odds, which can be easier to interpret in risk scoring.

Feature-weight scoring workflows

For linear classifiers, the score is z = b + Σ(wᵢxᵢ). This calculator supports quick “what-if” analysis by editing features and weights to see probability shifts. It helps validate sign and magnitude: a positive weight increases z when its feature rises, pushing P(y=1) upward after sigmoid.

Temperature calibration for reliability

Temperature scaling adjusts confidence using z' = z/T. With T>1, extreme probabilities move toward 0.5, improving calibration when a model is overconfident. With T<1, predictions sharpen. Because scaling happens on logits, ranking remains the same while probability reliability can improve for reporting. Fit T on validation to reduce log loss.

Batch scoring and evaluation with log loss

Batch mode scores many rows and previews results, while exports provide a complete table. If you include true labels, the calculator reports log loss, L = −[y ln(p) + (1−y) ln(1−p)]. Lower values indicate better probability estimates and more stable downstream decisions. Exports support segment comparisons of probability and error rates. When true labels are missing, you can still monitor probability drift by tracking histograms and percentile summaries.

FAQs

1) What is a logit in binary classification?

A logit is the log-odds score, z = ln(p/(1−p)). Many models output z, and probability is recovered with p = 1/(1+e−z).

2) Why change the decision threshold from 0.5?

Different applications value errors differently. Higher thresholds reduce false positives; lower thresholds reduce false negatives. Choose a threshold that matches costs, capacity, and risk tolerance.

3) What does temperature scaling do?

It rescales logits using z' = z/T. T>1 softens probabilities toward 0.5; T<1 sharpens them. It can improve calibration without changing score ordering.

4) Can I input odds directly?

Yes. Provide odds > 0, which are converted to logit using z = ln(odds), then mapped to probability with the sigmoid (including optional temperature).

5) What is log loss and when should I use it?

Log loss measures probability quality against true labels. It penalizes confident wrong predictions strongly, making it useful for calibration checks and model comparison.

6) How should I format batch data?

Use a header like id,logit,true_label, or id,prob,true_label, or id,odds,true_label. Without headers, use id,value,type,true_label where type is logit, prob, or odds.

Related Calculators

Logistic Probability CalculatorBinary Outcome ProbabilitySigmoid Probability ToolClassification Probability EstimatorEvent Probability PredictorYes No ProbabilityOutcome Likelihood CalculatorRisk Probability CalculatorConversion Probability ToolFraud Probability Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.