AI Glossary / Graphs and symbolic AI / Intermediate

Linear separator

Definition

A linear separator is a decision boundary defined by a weighted sum of features plus an offset. It divides feature space into two sides used for binary classification. In two dimensions the boundary is a line; in three it is a plane; in higher dimensions it is a hyperplane.

What it means

Each example is represented by numerical features. The separator combines them into a score, such as 2x + y - 5. Positive and negative scores lie on opposite sides of the boundary, while a zero score lies on it. A rule must specify how to classify an exact boundary case.
A dataset is linearly separable when a suitable boundary can place the two classes on opposite sides without classification errors under the relevant convention. Not every dataset has this property. Moreover, separating the training examples does not by itself establish that the rule will classify future examples well.

How it works

Write the score as w dot x + b, where x contains features, w contains weights, and b is an offset. The boundary is the set of points where this score equals zero. Different learning methods choose weights and offsets according to different objectives.
The perceptron and linear support vector machines are related examples, but the separator itself is a geometric object rather than one specific training algorithm. A model can use a linear boundary even when the observed classes overlap, accepting some errors. If features are transformed first, a boundary linear in those transformed features can appear nonlinear in the original coordinates.

Three practical examples

  • A simple document classifier can combine word-related numerical features into a score for two categories.
  • A teaching example can separate two groups of points on a two-dimensional plot and show the effect of changing the offset.
  • A model-review exercise can compare a linear baseline with a more flexible classifier to determine whether extra complexity improves held-out performance.

Think of it this way

Think of placing a straight ruler across a scatter plot to divide two kinds of marks. Moving or rotating the ruler changes the classification rule. The analogy is limited because real models may use thousands of features, and features can be transformed so that a straight boundary in feature space is curved in the original input space.

Worked example

Consider the invented rule s(x, y) = 2x + y - 5. Classify a point as positive when s is greater than zero and negative when it is less than zero; reserve zero for an explicit boundary decision.
For point A = (1, 1), the score is 2 + 1 - 5 = -2, so A is negative. For B = (2, 0), the score is 4 + 0 - 5 = -1, also negative. For C = (3, 0), the score is 6 - 5 = 1, so C is positive. For D = (2, 2), the score is 4 + 2 - 5 = 1, also positive. If these are their supplied labels, the rule separates all four training points.
Point E = (2, 1) has score zero and lies on the line. Boundary classification needs an explicit rule.
Multiplying the entire score by 10 produces 20x + 10y - 50. The zero boundary and positive-versus-negative predictions remain identical, although numerical scores become ten times larger. Bigger raw scores alone therefore do not prove greater geometric separation or greater confidence.
For the original weights, the Euclidean length of w = (2, 1) is the square root of 5. Point C's perpendicular distance to the boundary is 1 divided by the square root of 5, about 0.447 coordinate units. After multiplying weights and offset by 10, the corresponding distance is 10 divided by the square root of 500, the same value. This calculation assumes the stated Euclidean feature coordinates.

Illustrative case study

In a fictional document project, Birch Review presents a classifier's raw score as a percentage confidence. Another developer rescales every weight and the offset by the same positive factor. Predictions do not change, but the displayed percentages become radically different.
The team separates the decision rule from any probability estimate and explains the feature representation used by the model. This invented case illustrates why an uncalibrated score should not be interpreted as a probability simply because it comes from a classifier.

Common misconceptions and mistakes

A linear separator is commonly affine because it includes an offset; it need not pass through the origin. The term does not imply that every input feature has a causal effect on the class, or that all classes can be perfectly separated.
Do not confuse raw score magnitude with geometric distance unless the weight normalization is accounted for. Nor should a visually clean split on training data be treated as proof of reliable deployment behavior. Feature selection, scaling, label quality, and evaluation data all matter. A transformed feature space also changes what linear means geometrically.

Business use

A linear classifier can provide a useful baseline because its scoring rule is compact and often straightforward to inspect. Define each feature clearly and document preprocessing, including scaling and any transformations. Coefficients are meaningful only in relation to those definitions.
Evaluate the errors that matter to the application, not just whether a separator exists for the training sample. Examine borderline cases and state the classification threshold. When scores are shown to people, explain whether they are raw decision values, normalized distances, or calibrated probabilities. Those quantities answer different questions and should not share an ambiguous confidence label.

People also ask

Must the boundary pass through zero?

No. An offset allows a boundary that does not pass through the coordinate origin.

Can a linear classifier be used on nonseparable data?

Yes, but it cannot classify every observed point correctly with a single boundary in that feature representation.

Does multiplying all weights and the offset by a positive constant change predictions?

No, if the decision is based only on the sign of the score and boundary handling remains the same.

Check your understanding

Why do the scores 2x + y - 5 and 20x + 10y - 50 describe the same separator?

Answer: The second is ten times the first, so both become zero at the same points and have the same sign elsewhere. Their raw score scales differ, but the boundary does not.

Related terms

  • Linear classifier
  • Linear separability
  • Hyperplane
  • Perceptron
  • Support vector machine
  • Margin
  • Feature map
  • Decision boundary
  • Probability calibration

Learn next

Plot the worked points and the line 2x + y = 5. Move the offset and observe which predictions change. Then study the XOR pattern to understand why some labels cannot be separated by one line in the original two-dimensional representation.

More in Graphs and symbolic AI

  • Linear partial information - Linear partial information is a way to represent incomplete knowledge through linear restrictions, especially restrictions on probabilities or normalized...
  • Linear planning - Linear planning, in the historical classical-planning sense used here, solves subgoals through separate subplans and joins those subplans without...
  • Linear probing - Linear probing is a collision-resolution method for a hash table stored in an array.
  • Linear-quadratic regulator rapidly exploring random tree - Linear-quadratic regulator rapidly exploring random tree refers to motion-planning approaches that combine sampling-based tree search with linear-quadratic...
  • Linear resolution - Linear resolution is a strategy for organizing resolution proofs around a continuing chain of derived clauses.
  • Linear search - Linear search finds an item by checking entries one at a time until a match is found or the searchable collection is exhausted.

Sources

Andrew Ng, CS229 notes updated by Tengyu Ma, kernel methods and support vector machines: https://cs229.stanford.edu/summer2019/cs229-notes3.pdf Scikit-learn, linear models documentation: https://scikit-learn.org/stable/modules/linear_model.html

Previous: Linear separability Next: Linear shift-invariant (LSI) filter

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer