Concepts / Compression Schemes for Halfspaces

Compression Schemes for Halfspaces

Separating polynomials are functions of the form sign(p(x)), with p a degree-r polynomial on R^d.

  • Programming

Why Change the Representation

A separating polynomial classifies an input x by evaluating a polynomial p(x) and then taking its sign. The resulting function has the form sign(p(x)), where p is a degree-r polynomial on R^d. The key compression idea is not to compress the polynomial in its original coordinates directly. Instead, rewrite the polynomial as a linear expression in a new representation of the input. After this change of representation, the problem becomes a halfspace problem in a higher-dimensional space.

The central move is representation change: replace x by a feature vector ψ(x) containing the monomials of x up to degree r.

Separating Polynomial Functions

Separating polynomials are functions that map x in R^d to sign(p(x)), where p is a polynomial of degree r.

The polynomial p(x) produces a real-valued score. Taking its sign turns that score into the class decision represented by the function. The important point for compression is that p may contain monomials of different degrees, while the sign operation uses the final value of the whole polynomial.

evaluatetake signinner product with wtake signx in R^dψ(x)p(x)⟨w, ψ(x)⟩sign(p(x))sign(⟨w, ψ(x)⟩)
How does the same sign-based decision look before and after the representation change?

The before-and-after view does not change the function being represented. It changes the description of the score: p(x) is rewritten as an inner product involving ψ(x). That rewritten score is what exposes the halfspace structure.

Building the Feature Map

The feature map ψ(x) is formed from all monomials of x up to degree r. Each monomial becomes a coordinate in the transformed representation. The coefficients of the polynomial are collected into a vector w with matching coordinates.

coordinatecoordinatecoordinatecoordinatecoordinatecoordinatepaired withpaired with1constant monomialψ(x)monomial coordinates⟨w, ψ(x)⟩polynomial scorex₁degree 1wmatching coefficientsx₂degree 1x₁²degree 2x₁x₂degree 2x₂²degree 2
How do the monomials of x become coordinates of ψ(x), and how do matching coefficients in w produce p(x)?

The coordinates of ψ(x) and w are paired by monomial type. A coordinate for a particular monomial in ψ(x) is multiplied by the coefficient for that same monomial in w. Adding these coordinate-wise products gives the inner product ⟨w, ψ(x)⟩, which represents p(x).

A Concrete Polynomial Rewrite

Matching Monomials with Coefficients

Consider a generated two-variable polynomial of degree 2: p(x₁, x₂) = 3 + 2x₁ − x₂ + 4x₁² + 5x₁x₂ − 2x₂². Express its score as an inner product using a feature map containing monomials up to degree 2.

List the monomials: Use the monomials 1, x₁, x₂, x₁², x₁x₂, and x₂² as the coordinates of ψ(x).

Form the feature map: The feature map is ψ(x) = (1, x₁, x₂, x₁², x₁x₂, x₂²).

Collect the coefficients: The matching coefficient vector is w = (3, 2, −1, 4, 5, −2).

Take the inner product: The inner product ⟨w, ψ(x)⟩ multiplies each coefficient by its matching monomial and adds the results, reproducing p(x).

p(x) = ⟨w, ψ(x)⟩, so the corresponding decision function can be written as sign(⟨w, ψ(x)⟩).

The example illustrates the general pattern: ψ(x) stores monomials, w stores their coefficients, and the inner product reconstructs the polynomial score.

The Halfspace Reduction

Once p(x) is written as ⟨w, ψ(x)⟩, the separating-polynomial function becomes sign(⟨w, ψ(x)⟩). This has the form of a halfspace decision in the transformed feature space. The original input belongs to R^d, but the feature representation belongs to a higher-dimensional space R^d′, where d′ = O(d^r).

feature mapcombine with wcombine with ψ(x)take signx in R^dψ(x)monomials up to degree r⟨w, ψ(x)⟩sign(⟨w, ψ(x)⟩)halfspace decision in R^d′wpolynomial coefficients
How does mapping x to ψ(x) transform a polynomial sign decision into a linear halfspace decision?

This is a reduction of compression problems. To construct a compression scheme for separating polynomials, construct a compression scheme for halfspaces in the transformed space. The polynomial problem is therefore approached through the halfspace problem after the representation change.

rewrite p(x)change coordinatesuse sign(⟨w, ψ(x)⟩)apply halfspace compressionSeparating-polynomialproblemMonomialrepresentationψ(x)R^d′d′ = O(d^r)Halfspace problemHalfspace compressionscheme
What sequence of representation changes turns the polynomial compression problem into a halfspace compression problem?

The Role of the Vector w

The vector w has two linked interpretations. Algebraically, it is the coefficient vector that lets the polynomial score be written as ⟨w, ψ(x)⟩. Geometrically, it supplies the direction used by the halfspace representation in feature space. The source identifies w as the direction of the max-margin solution.

defines score with ψ(x)direction ofwcoefficient vector⟨w, ψ(x)⟩polynomial scorewdirection in feature spaceMax-margin solutiondirection identified with w
What does w represent in the polynomial formula, and how is it related to the max-margin solution?

Mistakes in the Reduction

  • Treating ψ(x) as the original input x.

    The reduction depends on replacing x with a representation containing all monomials up to degree r.

    Fix: Track the feature map explicitly and write the score as ⟨w, ψ(x)⟩.

  • Leaving polynomial coefficients out of w.

    The inner product reproduces p(x) only when the coordinates of w match the coefficients of the corresponding monomials.

    Fix: Pair every monomial coordinate in ψ(x) with its polynomial coefficient in w.

  • Assuming the transformed problem is still in R^d.

    The reduction uses a feature space R^d′, with d′ = O(d^r).

    Fix: Distinguish the original input dimension d from the transformed dimension d′.

  • Confusing the sign decision with the polynomial score.

    p(x) is the score, while sign(p(x)) is the separating-polynomial function.

    Fix: Keep the two stages separate: compute the polynomial score, then take its sign.

  • Describing w only as a coefficient list.

    The source also identifies w as the direction of the max-margin solution.

    Fix: State both roles: w represents polynomial coefficients and gives the relevant feature-space direction.

Practice the Representation Change

MEDIUM

Suppose p(x) is a degree-r polynomial on R^d. Describe the three representation questions that reveal why its compression problem can be treated as a halfspace compression problem.

Hints
  • First identify what ψ(x) contains.
  • Then state how p(x) is written using w and ψ(x).
  • Finally identify the hypothesis class and the dimension of the transformed space.

What do you think happens?

After rewriting p(x) as an inner product with ψ(x), what hypothesis class appears in the transformed space?

  • Halfspaces
  • Separating polynomials in the original coordinates
  • A new class unrelated to linear decisions
Reveal answer

Answer: Halfspaces

The rewritten decision has the form sign(⟨w, ψ(x)⟩), which is the halfspace form in the higher-dimensional feature space.

Key Takeaways

  1. A separating polynomial is a function of the form sign(p(x)), where p is a degree-r polynomial on R^d.
  2. The feature map ψ(x) contains all monomials of x up to degree r.
  3. With the polynomial coefficients collected in w, the score can be written as ⟨w, ψ(x)⟩.
  4. The decision sign(⟨w, ψ(x)⟩) is a halfspace decision in a higher-dimensional space R^d′, where d′ = O(d^r).
  5. The vector w is both the coefficient vector in the inner-product representation and the direction of the max-margin solution.

Key Takeaways

  • Separating polynomials classify inputs using sign(p(x)) for a degree-r polynomial p.
  • A feature map ψ(x) records all monomials up to degree r, allowing p(x) to be written as ⟨w, ψ(x)⟩.
  • This representation changes the polynomial decision into a halfspace decision in R^d′.
  • Compression for separating polynomials can therefore be reduced to compression for halfspaces in the higher-dimensional feature space.
  • The vector w encodes the polynomial coefficients and gives the direction of the max-margin solution.