For every μ>0, there is an efficient algorithm for agnostically learning halfspaces under the uniform distribution with an approximation ratio of (1+μ).
As noted above, showed that under a certain complexity assumption (hardness of learning sparse parity), there are no exact efficient algorithms (i.e., with approximation ratio α=1). In that case, our result is optimal.
Open questions: Obvious open questions are to extend our results to more distributions (uniform on {±1}d, permutation-invariant, product, log-concave, …) and more problems (learning intersection of halfspaces, functions of halfspaces, …). In addition, as opposed to previous approximation algorithms , our algorithm does not always return a halfspace classifier. A natural open question is therefore to find a proper PTAS.
Our algorithm and its analysis build on and combine various algorithmic and proof techniques that were previously used for learning halfspaces. This includes regression based algorithms (e.g. ), polynomial approximations of the sign function (e.g. ) and localization techniques . In this section we outline these techniques and the way we use them. Then, we present our PTAS, state its properties (theorem 1.5), and describe the course of the proof. The full proof is in sections 2 and 3.
1.3 Learning halfspaces using sign approximations
To use theorem 1.2 for learning halfspaces, we need to prove the existence of low degree polynomials P such that ∥h−P∥1,D is small, where h is a halfspace classifier. As explained below, this is naturally done by approximating the sign function, sign(x)={1−1x>0x≤0, with respect to an appropriate proximity measure.
1.4 Localization
An additional algorithmic component we will use, except polynomial regression, is localization in the instance and the hypotheses space (e.g. ). The basic idea is the following. Suppose that w∗∈Sd−1 defines the optimal halfspace. Suppose furthermore that we have found (say, using some simple algorithm) a vector w∈Sd−1 that defines a halfspace with a relatively small error. The facts that the marginal distribution is uniform and Err(hw) is small have two relevant consequences:
We know that the optimal vector, w∗, is close to w.
Hence, if ∣⟨w,x⟩∣ is large, then hw∗(x)=hw(x) and therefore we know hw∗(x).
There is an efficient learning algorithm with label complexity poly(d,log(η1)) that tolerates noise rate of α0η for some universal constant α0>1. Moreover, the algorithm is proper, that is, its output is a halfspace.
1.5 The PTAS and its analysis
In a nutshell, our algorithm first find (step 1) a “rough estimation”, w, of w∗. Then, it “localizes the learning” and apply more computation power (step 3), to a small strip T that is closed to hw’s decision boundary, and therefore, intuitively, we are less certain about hw’s prediction.
With appropriate choice of the parameters r,β,γ (depending on 0<μ,η≤1), algorithm 1 satisfies:
It tolerates noise rate of (1−μ)η.
It runs in time poly(dμ2log3(μ1),η1).
Its label complexity is poly(dμ2log3(μ1),log(η1)).
Proof outline. To prove theorem 1.5, we must show that we can choose the parameters so that the time and label complexity are as stated, and under the assumption that ErrD(hw∗)≤(1−μ)η, the error of the returned classifier satisfies ErrD(h)≤η. Below, we explain how we do that. We would naturally like to decompose the error into two parts:
We first handle the former summand using a localization lemma (lemma 2.1 below). We show that for γ=Θ(dηlog(μ1)), the probability that hw(x)=hw∗(x) outside the strip T, is ≤2μη. Hence, on the complement of T, the returned classifier, that coincides with hw, is as good as h∗, up to an additive error of 2μη. Concretely,
It remains to handle the latter summand in equation (4). It is enough to show that
Indeed, in that case it follows from equations (3), (4) and (5) that
We first (section 3.1) show how to find polynomials that approximate the sign function on all the points of a given segment [−a,a], except the area that is very close to the origin, say [−ϵ,ϵ]. To this end, we invoke Jackson’s theorem (theorem 1.3) to find a polynomial that roughly (up to an error of, say, 0.1) approximates the sign function on the mentioned regime. Namely, we find a polynomial p of degree O(ϵa) that maps [−a,−ϵ] (resp. [ϵ,a]) to [−1.1,−0.9] (resp. [0,9,1.1]). To move from accuracy of 0.1 to accuracy of some small τ>0, we compose p with another polynomial r that maps [−1.1,−0.9] (resp. [0.9,1.1]) to [−1−τ,−1+τ] (resp. [1−τ,1+τ]). Using the Taylor expansion of the the error function erf(x):=2π1∫−∞xe−2t2dt, we show that there exists such r of degree O(log(τ1)).
In the last step (section 3.3), using basic facts about high dimensional spherical geometry, we show that the distribution (D∣T×{±1})w∗ have strong enough tail bounds.
2 Related work
Proof of theorem 1.5
For localization arguments, we will use the following lemma.
Let w,w∗∈Sn−1 and let D be a distribution of Sd−1×{±1} such that D∣Sd−1 is uniform.
We have πθ(w,w∗)≤ErrD(w)+ErrD(w∗).
If x∈Sd−1 is a uniform vector, then for every r>0,
Proof For the first part we note that Prx∼D(hw(x)=hw∗(x))=πθ(w,w∗), while on the other hand,
Therefore, if PV(x)∈B and ∣⟨x,w⟩∣>r⋅θ(w,w∗) then hw(x)=hw∗(x). It follows that
Finally, let e1,e2∈V be an orthonormal basis. Note that if ∣⟨x,e1⟩∣≤2r and ∣⟨x,e2⟩∣≤2r then PV(x)∈B. Hence, we have
Here, the last inequality follows from the well known measure concentration bound according which for every e∈Sd−1 and σ>0 we have Pr(∣⟨x,e⟩∣≥σ)≤2exp(−41σ2d).
Lastly, we will also rely on the following complexity analysis of algorithm 1.
The runtime of algorithm 1 is poly(dr,β1,γ1,η1) and the label complexity is poly(dr,η1,log(η1)).
Proof The runtime of step 1 is poly(d,η1), while the label complexity is poly(d,log(η1)). For step 3, we can apply the algorithm on poly(dr,η1) examples and labels from the distribution D∣T. We can get these many examples by sampling poly(dr,β1,PrD(T×{±1})1) examples from D and keep and expose the labels of only the first poly(dr,β1) examples that fell in T. It is not hard to see that PrD(T×{±1})≥Ω(min(γd,1)). Hence, the runtime of step 3 is poly(dr,β1,γ1). To summarize, the total runtime is poly(dr,β1,γ1,η1) and the label complexity is poly(dr,β1,log(η1)).
By assumption, ErrD(hw∗)≤(1−μ)η. Hence, ErrD(P)≤η, as required. It also follows from lemma 2.4 that the runtime and label complexity are poly(dμ2log2(1/μ)) (note that η is bounded from below by a constant) as stated .
Next, we deal with the case that η≤2(1+α0)1. We will show that it is possible to choose r=Θ(μ2log3(μ1)), β=θ(log(μ1)μ) and γ=Θ(dηlog(μ1)) for which the algorithm will have the desired properties. Also, by lemma 2.4, for such a choice of parameters, the runtime and label complexity are as stated.
Let w∗ be the vector defining the optimal halfspace. By assumption, ErrD(hw∗)≤(1−μ)η. Let w be the vector found in step 1, and let P be the polynomial found in step 3. We first claim that we can assume w.l.o.g. that
and in that case the algorithm will return, in the last step, w.p. 21, a hypothesis with error at most η, as required.
Let h(x)={hw(x)sign(P(x))∣⟨w,x⟩∣>γ∣⟨w,x⟩∣≤γ. It is enough to show that ErrD(h)≤η. Let T=Td,γ(w):={u∈Sd−1:∣⟨w,u⟩∣≤γ}. The error of h is
Now, by an appropriate choice of γ=Θ(dηlog(μ1)), we get
We next deal with the term Pr(x,y)∼D(x∈T)⋅ErrD∣T(P). Since γ=Θ(dηlog(μ1)) we have that
Also, by equation (8) and the assumption that η≤2(α0+1)1, we have that 0≤θ≤2π. For this regime, sin(θ)≥π2θ. Hence, by equation (6) we have
By equations (10) and (11) we can choose β=4Clog(μ1)μ, where C>0 is a universal constant that is large enough so that
By equation 12 and lemma 2.3 we can choose r=Θ(β2log2(β1))=Θ(μ2log3(μ1)) such that
By equations (7), (9) and (13) we conclude that
Polynomial approximation of the sign function
Let a,γ,τ>0. There exist a polynomial p of degree O(γ1⋅log(τ1)) such that
For x∈[−a,a]∖[−γ⋅a,γ⋅a], ∣p(x)−sign(x)∣<τ.
Let τ>0. There exist a polynomial p of degree O(log(τ1)) such that
For x∈[−1.5,1.5]∖[−0.5,0.5], ∣p(x)−sign(x)∣<τ.
Proof The proof is established by approximating the error function, erf(x):=2π1∫−∞xe−2t2dt by a low degree polynomial. Let σ=22log(2πτ4). We claim that for every x>2σ we have
Because 0≤erf(x)≤1 for all x, and since erf(x)=1−erf(−x), it is enough to prove that erf(x)≥1−4τ. Indeed, we have
Now, by the Taylor expansion of ex we have
Integrating element-wise and using the fact that erf(0)=21, we have
Let r be the 2k’th Taylor polynomial of erf for k=max{⌈2(1.5σ)2e⌉,log2(τ4)}=O(log(τ1)). We have, for ∣x∣≤1.5σ≤2ek
Here, the 4’th inequality follows from the well known fact that n!≥2π(en)n. Finally, using the last inequality and equation (14), it is not hard to check that the polynomial p(x)=2r(σx)−1 satisfies the required properties.
2 Approximations for short tailed distributions
Then, for every 0<τ≤2γσ there is a polynomial of degreeThe constant in the big-O notation is universal. O(τ2log2(1/τ)) such that
Proof (of lemma 3.3) By lemma 3.1, there is a polynomial p of degree O(rlog(1/τ)) such that
For x∈[−rτσ,rτσ], ∣p(x)∣<2.
For x∈[−rτσ,−100τσ], ∣p(x)∣<100τ.
For x∈[100τσ,rτσ], ∣p(x)−1∣<100τ.
It remains to bound ∫∣x∣≥rτσ∣p(x)−sign(x)∣ρ(x)dx. We will choose r≥τ21, and therefore we will have rτσ≥τσ≥2γ. Hence, by lemma 3.4 we have
Now, it is possible to choose r=Θ(τ2log(1/τ)) such that for all y>rτ we have (rτ2y)r⋅e−64y2≤1. For such r, the last expression is bounded by 12∫ω(τ1)∞e−64y2dy=o(τ).
3 Approximation on a biased strip: proof of lemma 2.3
There is a univariate polynomial p of degree r=O(τlog2(1/τ)) such that
Lemma 3.5 follows immediately from lemma 3.3 with σ=dsin(θ), the assumptions that γ<21 and τ<2γdsin(θ), and the following bound:
We will use the following well known inequality
Let A be the probability of Td,γ(w) according to the uniform distribution. We have
Proof Let x be a uniform vector in the strip Td,γ(w), and let y=⟨w∗,x⟩. We note that ρd,γ,θ is the density of y. We write
where ⟨w,z⟩=0. For (w∗)⊥=w∗−⟨w∗,w⟩w we have,
We note that the density function of the distribution of α⋅cos(θ) is given by
Now, given α, z is a uniform vector of norm 1−α2 in the orthogonal complement of w, and (w∗)⊥ is a vector of norm sin(θ) in that space. It follows that the density function of ⟨(w∗)⊥,z⟩ given that α⋅cos(θ)=u is ρd−1,sin(θ)⋅1−cos2(θ)u2=ρd−1,sin2(θ)−tan2(θ)u2. It therefore follows that
Proof (of lemma 3.6) Let A be the probability of the strip Td,γ(w) according to the uniform distribution on the sphere. We have, using equations (15) and (16),
Proof (of lemma 2.2) By equation (1.1.3), in is enough to show that the there is a univariate polynomial p of degree r=O(τ2log2(1/τ)) such that
This, however, follows immediately from lemma 3.3 and equation (16).
Amit Daniely is a recipient of the Google Europe Fellowship in Learning Theory, and this research is supported in part by this Google Fellowship. The author thanks Pranjal Awasthi, Adam Klivans, Nati Linial, and Shai Shalev-Shwartz for valuable discussions and comments.