Concepts / Weight Vectors and Bias Terms

Weight Vectors and Bias Terms

A halfspace hypothesis assigns one of two labels to an input vector.

  • Programming

From Features to Two Labels

Suppose every instance in a feature space must receive one of two labels. A halfspace hypothesis provides the rule for making that binary decision. It separates the feature space into regions associated with the labels -1 and +1. The separation is controlled by a weight vector and a bias term.

classified byone possible resultone possible resultInput vectorHalfspace hypothesisweight vector and bias term+1positive label-1negative label
How does a halfspace hypothesis map an input vector to one of two class labels?

The Separating Boundary

The weight vector and bias parameter together determine the halfspace hypothesis. In two dimensions, the boundary associated with that hypothesis is a hyperplane that appears as a line. This line separates the feature space into two regions. The weight vector is perpendicular to the line, so it provides the direction used to describe the relationship between the boundary and the feature space.

perpendicular tocontainsdeterminescontainsFeature spaceFeature spaceWeight vectorperpendicular directionChanged parametersnew hypothesisHyperplanea line in two dimensionsHyperplanechanged boundary ororientation
How do the weight vector and bias term define a line that divides two-dimensional feature space?

The word halfspace refers to the regions created by the separating hyperplane. The hyperplane itself is the boundary; the regions on its sides are the parts of feature space associated with the two possible classifications.

Parameter Roles

Part of the hypothesisRole described in the model
Weight vectorHelps determine the hypothesis and is perpendicular to the hyperplane in two dimensions.
Bias termWorks with the weight vector to determine the hypothesis.
HyperplaneThe separating boundary; in two dimensions, it is a line.
Regions on the sidesThe areas associated with the positive and negative labels.
helps determinehelps determineproducesWeight vectorperpendicular to the lineHalfspace hypothesisbinary decision ruleHyperplaneline in two dimensionsBias termparameter of the hypothesis
How do the weight vector and bias term contribute to the hypothesis?

Reading the Two Sides

Classifying Points Relative to a Line

Imagine a two-dimensional feature space divided by the line produced by a halfspace hypothesis. Determine the label for an instance described as above the line and for an instance described as below the line.

Locate the boundary: The hyperplane is the separating line in the two-dimensional feature space.

Locate the first instance: An instance described as above the hyperplane belongs to the region associated with the positive label.

Locate the second instance: An instance described as below the hyperplane belongs to the region associated with the negative label.

Interpret the geometry: The words above and below describe the geometric relationship with the hyperplane and the direction of the weight vector. They do not necessarily mean physical up and down in an application.

The first instance receives the positive label, and the second instance receives the negative label.

relative positionrelative positionlabeledlabeledInput vectorAbove hyperplane+1positive labelBelow hyperplane-1negative label
How does the position of an input point relative to the hyperplane determine whether it receives the positive or negative label?

Common Interpretation Errors

  • Treating the hyperplane as one of the two regions.

    The hyperplane is the boundary. The regions on its sides are the parts associated with the two classifications.

    Fix: Distinguish the boundary from the two regions it separates.

  • Assuming above and below always mean physical up and down.

    The terms describe the geometric relationship with the hyperplane and the direction of the weight vector.

    Fix: Use the model's geometry rather than a literal physical interpretation.

  • Forgetting that the hypothesis has two possible labels.

    A halfspace hypothesis assigns one of two labels to an input vector.

    Fix: Keep the binary outcome in view: the two labels are -1 and +1.

  • Treating the weight vector or bias term as the entire hypothesis by itself.

    The weight vector and bias parameter together determine the hypothesis.

    Fix: Describe both parameters as parts of the same halfspace hypothesis.

Check Your Understanding

MEDIUM

A two-dimensional feature space contains a line that separates instances into two regions. Explain what the line represents, what determines the corresponding hypothesis, and how an instance on each side receives its label.

Hints
  • Identify the geometric name for the separating line.
  • Mention both the weight vector and the bias term.
  • Use the positive and negative labels -1 and +1.
  1. A halfspace hypothesis assigns one of two labels to an input vector. Its weight vector and bias term jointly determine the hypothesis. In two dimensions, the associated hyperplane is a line perpendicular to the weight vector. The line divides feature space into two regions: instances on the positive side receive the positive label, while instances on the negative side receive the negative label.

Key Takeaways

  • A halfspace hypothesis is a binary classification rule for an input vector.
  • The weight vector and bias term together determine the hypothesis.
  • In two-dimensional feature space, the hyperplane is a line perpendicular to the weight vector.
  • The hyperplane separates feature space into regions associated with positive and negative labels.
  • Above and below describe geometric relationships with the boundary and the weight-vector direction, not necessarily physical directions.