{'fraction_non_alphanumeric': 0.04495975469528555, 'fraction_numerical': 0.012188577999233422, 'mean_word_length': 4.370728694936187, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Self-Training of Halfspaces with Generalization Guarantees under Massart Mislabeling Noise Model

We investigate the generalization properties of a self-training algorithm with halfspaces. The approach learns a list of halfspaces iteratively from labeled and unlabeled training data, in which each iteration consists of two steps: exploration and pruning. In the exploration phase, the halfspace is found sequentially by maximizing the unsigned-margin among unlabeled examples and then assigning pseudo-labels to those that have a distance higher than the current threshold. The pseudo-labeled examples are then added to the training set, and a new classifier is learned. This process is repeated until no more unlabeled examples remain for pseudo-labeling. In the pruning phase, pseudo-labeled samples that have a distance to the last halfspace greater than the associated unsigned-margin are then discarded. We prove that the misclassification error of the resulting sequence of classifiers is bounded and show that the resulting semi-supervised approach never degrades performance compared to the classifier learned using only the initial labeled training set. Experiments carried out on a variety of benchmarks demonstrate the efficiency of the proposed approach compared to state-of-the-art methods.


Introduction
In recent years, several attempts have been made to establish a theoretical foundation for semi-supervised learning. These studies are mainly interested in the generalization ability of semi-supervised learning techniques [Rigollet, 2007, Maximov et al., 2018 and the utility of unlabeled data in the training process [Castelli and Cover, 1995, Singh et al., 2009, Li and Zhou, 2011. The majority of these works are based on the concept called compatibility in [Balcan and Blum, 2006], and try to exploit the connection between the marginal data distribution and the target function to be learned. The common conclusion of these studies is that unlabeled data will only be useful for training if such a relationship exists.
The three key types of relations considered in the literature are cluster assumption, manifold assumption, and low-density separation [Zhu, 2005, Chapelle et al., 2006]. The cluster assumption states that data contains homogeneous labeled clusters, and unlabeled training examples allow to recognize these clusters. In this case, the marginal distribution is viewed as a mixture of class conditional distributions, and semi-supervised learning has been shown to be superior to supervised learning in terms of achieving smaller finite-sample error bounds in some general cases, and in some others, it provides a faster rate of error convergence [Castelli and Cover, 1995, Rigollet, 2007, Maximov et al., 2018, Singh et al., 2009. In this line, [Ben-David and and, 2008] showed that the access to the marginal distribution over unlabeled training data would not provide sample size guarantees better than those obtained by supervised learning unless one assumes very strong assumptions about the conditional distribution over the class labels. Manifold assumption stipulates that the target function is in a low-dimensional manifold. [Niyogi, 2013] establishes a context through which such algorithms can be analyzed and potentially justified; the main result of this study is that unlabeled data may help the learning task in certain cases by defining the manifold. Finally, low-density separation states that the decision boundary lies in low-density regions. A principal way, in this case, is to employ a margin maximization strategy which results in pushing away the decision boundary from the unlabeled data [Chapelle et al., 2006, ch. 6]. Semi-supervised approaches based on this paradigm mainly assign pseudolabels to high-confident unlabeled training examples with respect to the predictions and include these pseudo-labeled samples in the learning process. However, [Chawla and Karakoulas, 2011] investigated empirically the problem of label noise bias introduced during the pseudo labeling process in this case and showed that the use of unlabeled examples could have a minimal gain or even degrade performance, depending on the generalization ability of the initial classifier trained over the labeled training data.
In this paper, we study the generalization ability of a self-training algorithm with halfspaces that operates in two steps. In the first step, halfspaces are found iteratively over the set of labeled and unlabeled training data by maximizing the unsigned-margin of unlabeled examples and then assigning pseudo-labels to those with a distance greater than a found threshold. The pseudo-labeled unlabeled examples are then added to the training set, and a new classifier is learned. This process is repeated until there are no more unlabeled examples to pseudo-label. In the second step, pseudo-labeled examples with an unsigned-margin greater than the last found threshold are removed from the training set.
Our contribution is twofold: (a) we present a first generalization bound for selftraining with halfspaces in the case where class labels of examples are supposed to be corrupted by a Massart noise model; (b) We show that the use of unlabeled data in the proposed self-training algorithm does not degrade the performance of the first halfspace trained over the labeled training data.
In the remainder of the paper, Section 2 presents the definitions and the learning objective. In Section 3, we present in detail the adaptation of the self-training algorithm for halfspaces. Section 4 presents a bound over the misclassification error of the classifier outputted by the proposed algorithm and demonstrates that this misclassification error is upper-bounded by the misclassification error of the fully supervised halfspace. In Section 5, we present experimental results, and we conclude this work in Section 6.

Framework and Notations
We consider binary classification problems where the input space X is a subset of R d , and the output space is Y = {−1, +1}. We study learning algorithms that operate in hypothesis space H d = {h w : X → Y} of centered halfspaces, where each h w ∈ H d is a Boolean function of the form h w (x) = sign( w, x ), with w ∈ R d such that w 2 ≤ 1.
Our analysis succeeds the recent theoretical advances in robust supervised learning of polynomial algorithms for training halfspaces under large margin assumption [Diakonikolas et al., 2019, Montasser et al., 2020, Diakonikolas and Kane, 2020, where the label distribution has been corrupted with the Massart noise model [Massart and Nédélec, 2006]. These studies derive a PAC bound for generalization error for supervised classifiers that depends on the corruption rate of the labeled training set and shed light on a new perspective for analyzing the self-training algorithm. Similarly, in our analysis, we suppose that self-training can be seen as learning with an imperfect expert. Whereat at each iteration, labels of the pseudo-labeled set have been corrupted with a Massart noise [Massart and Nédélec, 2006] oracle defined as: Definition 2.1 ( [Massart and Nédélec, 2006] noise oracle). Let C = {f : X → Y} be a class of Boolean functions over X ⊆ R d , with f an unknown target function in C, and 0 ≤ η < 1/2. Let η be an unknown parameter function such that Let D denote the joint distribution over X × Y generated by the above oracle with an unknown parameter function η such that E x∼Dx [η(x)] ≤ η. We suppose that the training set is composed of ℓ labeled samples S ℓ = (x i , y i ) 1≤i≤ℓ ∈ (X × Y) ℓ and u unlabeled samples X u = (x i ) ℓ+1≤i≤ℓ+u ∈ X u , where ℓ < < u. Furthermore, we suppose that each pair (x, y) ∈ X × Y is i.i.d. with respect to the probability distribution D, we denote by D x the marginal of D on x, and D y (x) the distribution of y conditional on x. Finally, for any integer d, let [d] = {0, ..., d}.

Learning objective
Given S ℓ and X u , our goal is to find a learning algorithm that outputs a hypothesis h w ∈ H d such that with high probability, the misclassification error P (x,y)∼D [h w (x) = y] is minimized and to show with high probability that the performance of such algorithm is better or equal to any hypothesis in H d obtained from S ℓ only. Here we denote by η w (x) = P y∼Dy(x) [h w (x) = y] the conditional misclassification error of a hypothesis h w ∈ H d with respect to D and w * the normal vector of h w * ∈ H d that achieves the optimal misclassification error; η η η * = min w, w 2 ≤1 By considering the indicator function ½ π defined as ½ π = 1 if the predicate π is true and 0 otherwise; we prove in the following lemma that the probability of misclassification of halfspaces over examples with an unsigned-margin greater than a threshold γ > 0 is bounded by the same quantity 1 > η η η > 0 that upper-bounds the misclassification error of these examples.
Lemma 2.1. For all h w ∈ H d , if there exist η η η ∈]0, 1[ and γ > 0 such that: Proof. For all hypotheses h w in H d , we know that the error achieved by h w in the region of margin γ from w satisfies E x∼Dx [(η w (x) − η η η)½ | w,x |≥γ ] ≤ 0; by rewriting the expectation, we obtain the following ≤ η η η and the result follows from the equality: Suppose that there exists a pair ( w, γ) minimizing: By defining η as: The following inequality holds: This inequality paves the way for the following claim, which is central to the self-training strategy described in the next section.
Claim 2.2. Suppose that there exists a pair ( w, γ) satisfying the minimization problem Proof. The requirements of Lemma 2.1 are satisfied with (w, γ) = ( w, γ) and η = η. This claim is then proved using the conclusion of Lemma 2.1 together with the fact that η ≤ η * .
The claim above demonstrates that for examples generated by the probability distribution D, there exists a region in X on either side of a margin γ to the decision boundary defined by w solution of (Eq. 1); where the probability of misclassification error of the corresponding halfspace in this region is upper-bounded by the optimal misclassification error η * . This result is consistent with semi-supervised learning studies that consider the margin as an indicator of confidence and search the decision boundary on low-density regions [Joachims, 1999, Grandvalet and Bengio, 2005, Amini et al., 2009].

Problem resolution
We use a block coordinate minimization method for solving the optimization problem (1). This strategy consists in first finding a halfspace with parameters w that minimizes Eq. (1) with a threshold γ = 0, and then by fixing w, finds the threshold γ for which Eq. (1) is minimum. We resolve this problem using the following claim, which links the misclassification error η w and the perceptron loss ℓ p (y, h w (x)) : Claim 2.3. For a given weight vector w, we have: (2) Proof. For a fixed weight vector w, we have that: The result then follows from the definition of the misclassification error, i.e., η w ( This claim shows that the minimization of the generalization error with ℓ p is equiva- cannot result in bounded misclassification error, as the distribution of margins | w, x | might vary widely between samples in X . In the following lemma, we show that it is possible to achieve bounded misclassification error under margin condition and L 2 -norm constraint.
Lemma 2.4. For a fixed distribution D, let R = max x∼Dx x 2 and γ > 0, let w andw be defined as follows: We then have: Proof. From the condition | w, x | ≥ γ in the expectation, we have: Applying the definition of w to the right-hand side of the above inequality gives: Using the Cauchy-Schwarz inequality and the definition of R, we get: Algorithm 1. Self-Training with Halfspaces Then from the definition of w, we know: Dividing the two inequalities above by R gives the result.
Lemma 2.4 guarantees that the approximation of the perceptron loss to the misclassification error is more accurate for examples that have a comparable distance to the halfspace. This result paves the way to our implementation of the self-learning algorithm.
The goal of the exploration phase is to discover the halfspace with the highest margin on the set of unlabeled samples that are not still pseudo-labeled. This is done by first, learning a halfspace that minimizes the empirical surrogate loss of R D (w) = E (x,y)∼D [ℓ p (y, h w (x))] over a set of labeled and already pseudo-labeled examples S (k) from S ℓ and X u : Once the halfspace with parameters w (k) is found, a threshold γ (k) , defined as the highest unsigned-margin in S (k) , is set such that the empirical loss over the set of examples in S (k) with unsigned-margin above γ (k) , is the lowest. In the pseudo-code of the algorithm, S x ∈ X u that are not pseudo-labeled are assigned labels, i.e., y = sign( w (k) , x ) iff | w (k) , x | ≥ γ (k) . These pseudo-labeled examples are added to S (k) and removed from X u , and a new halfspace minimizing Eq. (3) is found. Examples in S (k) are supposed to be misclassified by the oracle O(f, D x , η (k) ) following Definition 2.1 with the parameter function η (k) that refers to the conditional probability of corruption in S (k) defined as . Once the halfspace with parameters w (k) and threshold γ (k) are found such that there are no more unlabeled samples having an unsigned-margin larger than γ (k) , the pair (w (k) , γ (k) ) is added to the list L m , and samples from S (k) having an unsigned-margin above γ (k) are removed (pruning phase). Remind that γ (k) is the largest threshold above which the misclassification error over S (k) increases.
To classify an unknown example x, the prediction of the first halfspace with normal vector w (i) in the list L m , such that the unsigned-margin | w (i) , x | of x is higher or equal to the corresponding threshold γ (i) , is returned. By abuse of notation, we note that the prediction for x is L m (x) = h w (i) (x). From Claim 2.2, we know that the misclassification error of this halfspace on the region where x lies is bounded by the optimal misclassification error η * . If no such halfspace exists, the observation is classified using the prediction of the first classifier h w (1) that was trained over all the labeled and the pseudo-labeled samples without pruning; i.e., L m (x) = h w (1) (x).

Corruption noise modeling and Generalization guarantees
In the following, we relate the process of pseudo-labeling to the corruption noise model O(f, D x , η (k) ) for all pseudo-labeling iterations k in Algorithm 1, then we present a bound over the misclassification error of the classifier L m outputted by the algorithm and demonstrate that this misclassification error is upper-bounded by the misclassification error of the fully supervised halfspace.
when no examples are pseudo-labeled. Then the noise distribution η (k) satisfies for all k ∈ [K]: If we condition on x ∈ S (k) , we obtain for all k ∈ [K]: this equation includes the initial corruption of the labeled set S (0) = S ℓ in addition to the noise injected by each classifier h w (k) at each round k when pseudo-labeling occurs. Now that we have modeled the process of pseudo-labeling, the result is straightforward considering the fact that We can now state our main contribution that bounds the generalization error of the classifier L m outputted by Algorithm 1 with respect to the optimal misclassification error η * in the case where projected SGD is used for the minimization of Eq. (3). Note that in this case the time complexity of the algorithm is polynomial with respect to the dimension d, the upper bound on the bit complexity of examples, the total number of iterations, and the upper bound on SGD steps.

Theorem 4.2. Let S ℓ be a set of i.i.d. samples of size ℓ drawn from a distribution
where f is an unknown concept function and η (0) an unknown parameter function bounded by 1/2, let X u be an unlabeled set of size u drawn i.i.d. from D x . Algorithm 1 terminates after K iterations, and outputs a non-proper classifier L m of m halfspaces such that with high probability: where I is the set of rounds k ∈ [K] at which the halfspaces were added to L m , ǫ (k) is the projected SGD convergence error rate at round k, and π K+1 a negligible not-accounted mass of D x .
The proof of Theorem 4.2 is based on the following property of projected SGD.  , 2016]). LetR be a convex function of any type. Consider the projected SGD iteration, which starts with w (0) and computes for each step. w (t+ 1 2 ) = w (t) − α (t) g (t) ; w (t+1) = argmin Proof of Theorem 4.2. We consider the steps of Algorithm 1. At iteration k of the while loop, we consider the active training set S (k) consisting of examples not handled in previous iterations.
We first note that the algorithm terminates after at most K iterations. From the fact that at every iteration k, we discard a non-empty set from S (k) when we do not pseudo-label or from U (k) when we pseudo-label, and that the empirical distributions S ℓ and X u are finite sets. By the guarantees of Lemma 4.3, running SGD (step 4) onR S (k) for T = Ω(log(1/δ)/ǫ 2 ) steps, we obtain a weight vector w (k) such that with probability at least 1 − δ: from Claim 2.3, we derive with high probability: Then the margin γ (k) is estimated minimizing Eq. (1) given w (k) , following Lemma 2.4 with R (k) = max x∼Dx x 2 the radius of the truncated support of the marginal distribution D x at iteration k, we can assume that γ (k) R (k) ≈ 1, ∀k ∈ [K], one may argue that the assumption is unrealistic knowing that the sequence of (γ (k) ) m k=1 decreases overall, but as we show in the supplementary, we prove in Theorem B.1 that under some convergence guarantees of the pairs {(w (k) , w (k+1) )} m−1 k=1 , one can show that the sequence {R (k) } m k=1 decreases as a function of γ (k) respectively to k. As a result, we can derive with high probability: From the statement of Claim 2.2 and giving the pair (w (k) , γ (k) ), we obtain with high probability that at round k: When the while loop terminates, we have accounted m ≤ K halfspaces in the list L m satisfying Eq. (4). For all k ∈ I, every classifier h w (k) in L m has guarantees on an empirical distribution mass of at least κ = min k∈I P x∼S (k) [| w (k) , x | ≥ γ (k) ]; the DKW (Dvoretzky-Kiefer-Wolfowitz) inequality [Dvoretzky et al., 1956] implies that the true probability mass κ = min The pruning phase in the algorithm ensures that these regions are disjoint for all halfspaces in L m , it follows that using the Boole-Fréchet inequality [Boole, 2015] on the conjunctions of Eq. (4) overall rounds k ∈ [I], implies that L m classifies at least a (1−mκ)-fraction of the total probability mass of D with guarantees of Eq. (4) with high probability, let π K+1 = P x∼Dx [x ∈ S (K+1) ] be the probability mass of the region not accounted by L m . We argue that this region is negligible from the fact that |S (K+1) | < ℓ and ℓ ≪ u, such that setting ǫ = max k∈I ǫ (k) + π K+1 provides the result.
In the following, we show that the misclassification error of the classifier L m output of Algorithm 1 is at most equal to the error of the supervised classifier obtained over the labeled training set S ℓ , when using the same learning procedure. This result suggests that the use of unlabeled data in Algorithm 1 does not degrade the performance of the initial supervised classifier.
where f is an unknown concept function and η (0) an unknown parameter function bounded by 1/2, let X u be an unlabeled set of size u drawn i.i.d. from D x . Let L m be the output of Algorithm 1 on input S ℓ and X u , and let h w (0) be the halfspace of the first iteration obtained from the empirical distribution S (0) = S ℓ , there is a high probability that: Proof. Let k be the iteration at which the first pair (w (1) , γ (1) ) is added to L m . The first pruning phase in Algorithm 1 results in a set S (k) ⊆ S ℓ ∪ k−1 i=1 S (i) u . Claim 4.1 ensures that the probability of corruption in the pseudo-labeled set In other words, the weight vector w (1) is obtained from an empirical distribution that includes both the initial labeled set S ℓ and a pseudo-labeled set from X u . Particularly, if this pseudo-labeled set is not empty, then its pseudo-labeling error is nearly optimal, which implies that Ultimately, L m classifies a large fraction of the probability mass of D with nearly optimal guarantees (e.i., Eq. (4) in proof of Theorem 4.2) and the rest using h w (1) with an error of misclassification at most equal to P (x,y)∼D [h w (0) (x) = y].

Empirical Results
We compare the proposed approach to state-of-the-art strategies developed over the three fundamental working assumptions in semi-supervised learning over ten publicly available datasets. We shall now describe the corpora and methodology.
We used tf-idf representation for all textual data sets above. spambase is a collection of spam e-mails from the UCI repository [Dua and Graff, 2017]. one-two, odd-even are handwritten digits recognition tasks originally from optical recognition of handwritten digits database also from UCI repository, one-two is digits "1" versus "2"; odd-even is the artificial task of classifying odd "1, 3, 5, 7, 9" versus even "0, 2, 4, 6, 8" digits. weather is a data set from Kaggle which contains about ten years of daily weather observations from many locations across Australia, and the objective is to classify nextday rain target variable. We have also included data sets from extreme classification repository [Bhatia et al., 2016] mediamill2 and delicious2 by selecting the label which gives the best ratio in class distribution. The statistics of these data sets are given in Table 1.
Baseline methods. We implemented the halfspace or Linear Threshold Function (LTF) using TensorFlow 2.0 in python aside with Algorithm 1 1 (L m ), we ran a Support Vector Machine (SVM) [Cortes and Vapnik, 1995] with a linear kernel from the LIB-LINEAR library [Fan et al., 2008] as another supervised classifier. We compared results with a semi-supervised Gaussian naive Bayes model (GM) [Chapelle et al., 2006] from the scikit-learn library. The working hypothesis behind (GM) is the cluster assumption stipulating that data contains homogeneous labeled clusters, which can be detected using unlabeled training samples. We also compared results with label propagation (LP) [Zhu and Ghahramani, 2002] which is a semi-supervised graph-based technique. We used the implementation of LP from the scikit-learn library. This approach follows the manifold assumption that the decision boundary is located on a low-dimensional manifold and that unlabeled data may be utilized to identify it. We also included entropy regularized logistic regression (ERLR) proposed by [Grandvalet and Bengio, 2005] from [Krijthe, 2017]. This approach is based on low-density separation that stipulates that the decision boundary lies on low-density regions. In the implementation of [Krijthe, 2017], the initial supervised classifier is a logistic regression that has a similar performance to the SVM classifier. We tested these approaches with relatively small labeled training sets ℓ ∈ {10, 50, 100}, and because labeled information is scarce, we used the default hyper-parameters for all approaches. Analysis of results. Table 2 summarizes the results. We used boldface (resp. underline) to indicate the highest (resp. the second-highest) performance rate, and the symbol ↓ indicates that performance is significantly worse than the best result, according to a Wilcoxon rank-sum test with a p-value threshold of 0.01 [Wolfe, 2012]. From these results, it comes out that the proposed approach (L m ) consistently outperforms the supervised halfspace (LTF). This finding is in line with the result of Theorem 4.4. Furthermore, compared to other techniques, L m generally performs the best or the second-best. We also notice that in some cases, LP, GM, and ERLR outperform the supervised approaches, SVM and LTF (i.e., GM on spambase for ℓ ∈ {10, 50}), but in other cases, they are outperformed by both SVM and LTF (i.e., GM on religionatheism). These results suggest that unlabeled data contain useful information for classification and that existing semi-supervised techniques may use it to some extent. They also highlight that the development of semi-supervised algorithms following the given assumptions is necessary for learning with labeled and unlabeled training data but not sufficient. The importance of developing theoretically founded semi-supervised algorithms exhibiting the generalization ability of the method can provide a better understanding of the usefulness of unlabeled training data in the learning process.

Conclusion
In this study, we present a first bound over the misclassification error of a self-training algorithm that iteratively finds a list of halfspaces from partially labeled training data. Each round consists of two steps: exploration and pruning. The exploration phase's purpose is to determine the halfspace with the largest margin and assign pseudo-labels to unlabeled observations with an unsigned-margin larger than the discovered threshold. The pseudo-labeled instances are then added to the training set, and the procedure is repeated until there are no more unlabeled instances to pseudo-label. In the pruning phase, the last halfspace with the largest threshold is preserved, ensuring that there are no more unlabeled samples with an unsigned-margin greater than this threshold and pseudo-labeled samples with an unsigned-margin greater than the specified threshold are removed. Our findings are based on recent theoretical advances in robust supervised learning of polynomial algorithms for training halfspaces under large margin assumptions with a corrupted label distribution using the Massart noise model. We ultimately show that the use of unlabeled data in the proposed self-training algorithm does not degrade the performance of the initially supervised classifier. As future work, we are interested in quantifying the real gain of learning with unlabeled and labeled training data compared to a fully supervised scheme.