Skip to content

Task Types

Binary Classification

In shortA supervised machine learning task where the model sorts each item into one of exactly two classes, such as yes or no, spam or not spam.

Updated 24 Oct 2026· 2 min read

Binary classification is a supervised machine learning task in which the model predicts one of exactly two outcomes for each item. Is this page mobile-friendly, yes or no? Is this review spam? Is this query written by a person or generated by a machine? It is the simplest shape a classification problem can take, and often the best place to start.

How it works

You train the model on labelled examples, where each example already has the right answer (1 for the positive class, 0 for the negative). Most binary classifiers output a probability for the positive class, and a threshold, often 0.5, turns that probability into a label. Moving the threshold trades one kind of mistake for another: a lower threshold catches more true positives but lets in more false alarms.

Common algorithms include logistic regression, decision trees, random forests and support vector machines. Results are judged with a confusion matrix and metrics such as precision, recall and accuracy.

How it’s used in SEO and marketing

  • Performance prediction. Will this page reach the top 10, yes or no, using features such as content length, title structure and search volume.
  • Query screening. MLforSEO’s synthetic vs user query notebook separates queries into two classes with both rule-based and machine learning detection.
  • Quality flags. Spammy or safe backlink, review to report or keep, branded or non-branded query.
  • Marketing. Will this customer churn, will this subscriber open the email.

Example

Say you want to flag pages that need a content refresh. You label 300 pages from last year as “refreshed and improved” or “did not need it”, add features such as age, clicks trend and word count, and train a logistic regression. The model then gives every live page a probability, and you review the pages above your chosen threshold first.

Limitations and things to watch

  • Imbalanced data. If 95% of examples are “no”, a model can look accurate by saying “no” to everything. Check precision and recall, and use resampling or class weights.
  • Threshold choice. The default cut-off is rarely the best one for your use case; pick it based on the cost of each type of error.
  • Labels decide quality. Inconsistent or biased labels produce a confidently wrong model.
  • Two boxes may be too few. If items genuinely belong to several categories, use multi-class or multi-label classification instead.

Learn it on MLforSEO

Where Binary Classification shows up on MLforSEO

Sources and further reading

Other terms from Task Types

See all 13 Task Types terms →