{'fraction_non_alphanumeric': 0.047667317097894124, 'fraction_numerical': 0.010567395656470946, 'mean_word_length': 4.1537155543946715, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On Coresets for Support Vector Machines

We present an efficient coreset construction algorithm for large-scale Support Vector Machine (SVM) training in Big Data and streaming applications. A coreset is a small, representative subset of the original data points such that a models trained on the coreset are provably competitive with those trained on the original data set. Since the size of the coreset is generally much smaller than the original set, our preprocess-then-train scheme has potential to lead to significant speedups when training SVM models. We prove lower and upper bounds on the size of the coreset required to obtain small data summaries for the SVM problem. As a corollary, we show that our algorithm can be used to extend the applicability of any off-the-shelf SVM solver to streaming, distributed, and dynamic data settings. We evaluate the performance of our algorithm on real-world and synthetic data sets. Our experimental results reaffirm the favorable theoretical properties of our algorithm and demonstrate its practical effectiveness in accelerating SVM training.


Introduction
Popular machine learning algorithms are computationally expensive, or worse yet, intractable to train on massive data sets, where the input data set is so large that it may not be possible to process all the data at one time. A natural approach to achieve scalability when faced with Big Data is to first conduct a preprocessing step to summarize the input data points by a significantly smaller, representative set. Off-the-shelf training algorithms can then be run efficiently on this compressed set of data points. The premise of this two-step learning procedure is that the model trained on the compressed set will be provably competitive with the model trained on the original set -as long as the data summary, i.e., the coreset, can be generated efficiently and is sufficiently representative.
Coresets are small weighted subsets of the training points such that models trained on the coreset are approximately as good as the ones trained on the original (massive) data set. Coreset constructions were originally introduced in the context of computational geometry [1] and subsequently generalized for applications to other problems, such as logistic regression, neural network compression, and mixture model training [6,7,11,18,21] (see [10] for a survey).
A popular coreset construction technique -and the one that we leverage in this paper -is to use importance sampling with respect to the points' sensitivities. The sensitivity of each point is defined to be the worst-case relative impact of each data point on the objective function. Points with high sensitivities have a large impact on the objective value and are sampled with correspondingly high probability, and vice-versa. The main challenge in generating small-sized coresets often lies in evaluating the importance of each point in an accurate and computationally-efficient way.

Our Contributions
In this paper, we propose an efficient coreset construction algorithm to generate compact representations of large data sets to accelerate SVM training. Our approach hinges on bridging the SVM problem with that of k-means clustering. As a corollary to our theoretical analysis, we obtain theoretical justification for the widely reported empirical success of using k-means clustering as a way to generate data summaries for large-scale SVM training. In contrast to prior approaches, our approach is both (i) provably efficient and (ii) naturally extends to streaming or dynamic data settings. Above all, our approach can be used to enable the applicability of any off-the-shelf SVM solver -including gradient-based and/or approximate ones, e.g., Pegasos [27], to streaming and distributed data settings by exploiting the composibility and reducibility properties of coresets [10].
In particular, this paper contributes the following: 1. A coreset construction algorithm for accelerating SVM training based on an efficient importance sampling scheme. 2. An analysis proving lower bounds on the number of samples required by any coreset construction algorithm to approximate the input data set. 3. Theoretical guarantees on the efficiency and accuracy of our coreset construction algorithm. 4. Evaluations on synthetic and real-world data sets that demonstrate the effectiveness of our algorithm in both streaming and offline settings.

Related Work
Training SVMs requires O(n 3 ) time and O(n 2 ) space in the offline setting where n is the number of training points. Towards the goal of accelerating SVM training in the offline setting, [28,29] introduced the Core Vector Machine (CVM) and Ball Vector Machine (BVM) algorithms, which are based on reformulating the SVM problem as the Minimum Enclosing Ball (MEB) problem and Enclosing Ball (EB) problem, respectively, and by leveraging existing coreset constructions for each; see [5]. However, CVM's accuracy and convergence properties have been noted to be at times inferior relative to those of existing SVM implementations [22]; moreover, unlike the algorithm presented in this paper, neither the CVM, nor the BVM algorithm extends naturally to streaming or dynamic settings where data points are continuously inserted or deleted. Similar geometric approaches, including extensions of the MEB formulation, those based on convex hulls and extreme points, among others, were investigated by [2,12,14,16,24,26]. Another class of related work includes the use of canonical optimization algorithms such as the Frank-Wolfe algorithm [8], Gilbert's algorithm [8,9], and a primal-dual approach combined with Stochastic Gradient Descent (SGD) [15]. SGD-based approaches, such as Pegasos [27], have been a popular tool of choice in approximately-optimal SVM training. Pegasos is a stochastic sub-gradient algorithm for obtaining a (1 + ε)-approximate solution to the SVM problem in O(dnλ/ε) time for a linear kernel, where λ is the regularization parameter and d is the dimensionality of the input data points. In contrast to our method, these approaches and their corresponding theoretical guarantees do not feasibly extend to dynamic data sets and/or streaming settings. In particular, gradient-based approaches cannot be trivially extended to streaming settings since the arrival of each input point in the stream results in a change of the gradient.
There has been prior work in streaming algorithms for SVMs, such as those of [2,14,25,26]. However, these works generally suffer from poor practical performance in comparison to that of approximately optimal SVM algorithms in the offline (batch) setting, high difficulty of implementation and application to practical settings, and/or lack of strong theoretical guarantees. Unlike the algorithms of prior work, our method is simultaneously simple-to-implement, exhibits theoretical guarantees, and naturally extends to streaming and dynamic data settings, where the input data set is so large that it may not be possible to store or process all the data at one time.

Problem Definition
Let P = (x, y) : x ∈ R d × 1, y ∈ {±1} denote a set of n input points. Note that for each point p = (x, y) ∈ P , the last entry x d+1 = 1 of x accounts for the bias term embedding into the feature space 3 . To present our results with full generality, we consider the setting where the input points P may have weights associated with them. Hence, given P and a weight function u : P → R ≥0 , we let P = (P, u) denote the weighted set with respect to P and u. The canonical unweighted case can be represented by the weight function that assigns a uniform weight of 1 to each point, i.e., u(p) = 1 for every point p ∈ P . For every T ⊆ P , let U (T ) = p∈T u(p). We consider the scenario where n is much larger than the dimension of the data points, i.e., n d. For a normal to a separating hyperplane w ∈ R d+1 , let w 1:d denote vector which contains the first d entries of w. The last entry of w (w d+1 ) encodes the bias term b ∈ R. Under this setting, the hinge loss of any point p = (x, y) ∈ P with respect to a normal to a separating hyperplane, w ∈ R d+1 , is defined as h(p, w) = [1 − y x, w ] + , where [·] + = max{0, ·}. As a prelude to our subsequent analysis of sensitivity-based sampling, we quantify the contribution of each point p = (x, y) ∈ P to the SVM objective function as where λ ∈ [0, 1] is the SVM regularization parameter, and h(p, w) = [1 − y x, w ] + is the hinge loss with respect to the query w ∈ R d+1 and point p = (x, y). Putting it all together, we formalize the λ-regularized SVM problem as follows.
Definition 1 (λ-regularized SVM Problem). For a given weighted set of points P = (P, u) and a regularization parameter λ ∈ [0, 1], the λ-regularized SVM problem with respect to P is given by We let w * denote the optimal solution to the SVM problem with respect to P, i.e., w * ∈ argmin w∈R d+1 F λ (P, w). A solutionŵ ∈ R d+1 is an ξ-approximation to the SVM problem if F λ (P,ŵ) ≤ F λ (P, w * ) + ξ. Next, we formalize the coreset guarantee that we will strive for when constructing our data summaries.

Coresets.
A coreset is a compact representation of the full data set that provably approximates the SVM cost function (2) for every query w ∈ R d+1 -including that of the optimal solution w * . We formalize this notion below for the SVM problem with objective function F λ (·) as in (2) below.
Definition 2 (ε-coreset). Let ε ∈ (0, 1) and let P = (P, u) be the weighted set of training points as before. A weighted subset S = (S, v), where S ⊂ P and v : S → R ≥0 is an ε-coreset for P if This strong guarantee implies that the models trained on the coreset S with any off-the-shelf SVM solver will be approximately (and provably) as good as the optimal solution w * obtained by training on the entire data set P. This also implies that, if the size of the coreset is provably small, e.g., logartihmic in n (see Sec. 5), then an approximately optimal solution can be obtained much more quickly by training on S rather than P, leading to computational gains in practice for both offline and streaming data settings (see Sec. 6). The difficulty in constructing coresets lies in constructing them (i) efficiently, so that the preprocess-then-train pipeline takes less time than training on the full data set and (ii) accurately, so that important data points -i.e., those that are imperative to obtaining accurate models -are not left out of the coreset, and redundant points are eliminated so that the coreset size is small. In the following sections, we introduce and analyze our coreset algorithm for the SVM problem.

Method
Our coreset construction scheme is based on the unified framework of [11,18] and is shown in Alg. 1. The crux of our algorithm lies in generating the importance sampling distribution via efficiently computable upper bounds (proved in Sec. 5) on the importance of each point (Lines 1-10). Sufficiently many points are then sampled from this distribution and each point is given a weight that is inversely proportional to its sample probability (Lines 11-12). The number of points required to generate an ε-coreset with probability at least 1 − δ is a function of the desired accuracy ε, failure probability δ, and complexity of the data set (t from Theorem 1). Under mild assumptions on the problem at hand (see Sec. A.4), the required sample size is polylogarithmic in n.
Algorithm 1: Coreset(P, u, λ, ξ, k, m) Input : A set of training points P ⊆ R d+1 × {−1, 1} containing n points, weight function u : P → R ≥0 , a regularization parameter λ ∈ [0, 1], an approximation factor ξ > 0, a positive integer k, a sample size m Output : An weighted set (S, v) which satisfies Theorem 1 1w ← An ξ-approximation for the optimal SVM of (P, u); Py ← all the points in P that are associated with the label y; Our algorithm is an importance sampling procedure that first generates a judicious sampling distribution based on the structure of the input points and samples sufficiently many points from the original data set. The resulting weighted set of points S = (S, v), serves as an unbiased estimator for F λ (P, w) for any query w ∈ R d+1 , i.e., E[F λ (S, w)] = F λ (P, w). Although sampling points uniformly with appropriate weights can also generate such an unbiased estimator, it turns out that the variance of this estimation is minimized if the points are sampled according to the distribution defined by the ratio between each point's sensitivity and the sum of sensitivities, i.e., γ(p)/t on Line 12 [4].

Computational Complexity
Coresets are intended to provide efficient and provable approximations to the optimal SVM solution. However, the very first line of our algorithm entails computing an (approximately) optimal solution to the SVM problem. This seemingly eerie phenomenon is explained by the merge-and-reduce technique [13] that ensures that our coreset algorithm is only run against small partitions of the original data set [7,13,23]. The merge-and-reduce approach (depicted in Alg. 2 in Sec. B of the appendix) leverages the fact that coresets are composable and reduces the coreset construction problem for a (large) set of n points into the problem of computing coresets for n 2|S| points, where 2|S| is the minimum size of input set that can be reduced to half using Algorithm 1 [7]. Assuming that the sufficient conditions for obtaining polylogarithmic size coresets implied by Theorem 1 hold, the overall time required is approximately linear in n.

Analysis
In this section, we analyze the sample-efficiency and computational complexity of our algorithm. The outline of this section is as follows: we first formalize the importance (i.e., sensitivity) of each point and summarize the necessary conditions for the existence of small coresets. We then present the negative result that, in general, sublinear coresets do not exist for every data set (Lem. 1). Despite this, we show that we can obtain accurate approximations for the sensitivity of each point via an approximate k-means clustering (Lems. 2 and 3), and present non-vacuous, data-dependent bounds on the sample complexity (Thm. 1). Our technical results in full with corresponding proofs can be found in the Appendix.

Preliminaries
We will henceforth state all of our results with respect to the weighted set of training points P = (P, u), λ ∈ [0, 1], and SVM cost function F λ (as in Sec. 3). The definition below rigorously quantifies the relative contribution of each point.
Definition 3 (Sensitivity [7]). The sensitivity of each point p ∈ P is given by Note that in practice, exact computation of the sensitivity is intractable, so we usually settle for (sharp) upper bounds on the sensitivity γ(p) ≥ s(p) (e.g., as in Alg. 1). Sensitivity-based importance sampling then boils down to normalizing the sensitivities by the normalization constant -to obtain an importance sampling distribution -which in this case is the sum of sensitivities t = p∈P s(p). It turns out that the required size of the coreset is at least linear in t [7], which implies that one immediate necessary condition for sublinear coresets is t ∈ o(n).

Lower bound for Sensitivity
The next lemma shows that a sublinear-sized coreset cannot be constructed for every SVM problem instance. The proof of this result is based on demonstrating a hard point set for which the sum of sensitivities is Ω(nλ), ignoring d factors, which implies that sensitivity-based importance sampling roughly boils down to uniform sampling for this data set. This in turn implies that if the regularization parameter is too large, e.g., λ = θ(1), and if d n (as in Big Data applications) then the required number of samples for property (3) to hold is Ω(n).

Lemma 1.
For an even integer d ≥ 2, there exists a set of weighted points P = (P, u) such that We next provide upper bounds on the sensitivity of each data point with respect to the complexity of the input data. Despite the non-existence results established above, our upper bounds shed light into the class of problems for which small-sized coresets are ensured to exist.

Sensitivity Upper Bound
In this subsection we present sharp, data-dependent upper bounds on the sensitivity of each point. Our approach is based on an approximate solution to the k-means clustering problem and to the SVM problem itself (as in Alg. 1). To this end, we will henceforth let k be a positive integer, ξ ∈ [0, F λ (P, w * )] be the error of the (coarse) SVM approximation, and let (c and p ∈ P as in Lines 4-9 of Algorithm 1. Lemma 2. Let k be a positive integer, ξ ∈ [0, F λ (P, w * )], and let P = (P, u) be a weighted set. Then for every i ∈ [k], y ∈ {+, −} and p ∈ P Lemma 3. In the context of Lemma 2, the sum of sensitivities is bounded by Theorem 1. For any ε ∈ (0, 1/2), δ ∈ (0, 1), let m be an integer satisfying where t is as in Lem. 3. Invoking Coreset with the inputs defined in this context yields a ε-coreset S = (S, v) with probability at least 1 − δ in O (nd + T ) time, where T represents the computational complexity of obtaining an ξ-approximated solution to SVM and applying k-means++ on P + and P − .
We refer the reader to Sec. A.4 of the Appendix for the sufficient conditions required for obtaining poly-logarithmic sized coreset, and to Sec. C of the Appendix for additional details on the effect of the k-means clustering on the sensitivity bounds.

Results
In this section, we present experimental results that demonstrate and compare the effectiveness of our algorithm on a variety of synthetic and real-world data sets in offline and streaming data settings [20]. Our empirical evaluations demonstrate the practicality and wide-spread effectiveness of our approach: our algorithm consistently generated more compact and representative data summaries, and yet incurred a negligible increase in computational complexity when compared to uniform sampling. Additional results and details of our experimental setup and evaluations can be found in Sec. D of the Appendix. Table 1: The number of input points and measurements of the total sensitivity computed empirically for each data set in the offline setting. The sum of sensitivities is significantly less than n for virtually all of the data sets, which, by Thm. 1, ensures the sample-efficiency of our approach on the evaluated scenarios. Evaluation We considered 6 real-world data sets of varying size and complexity as depicted in Table 1 (also see Sec. D of the Appendix). For each data set of size n, we selected a set of M = 15 geometrically-spaced subsample sizes m 1 , . . . , m M ⊂ [log n, n 4/5 ]. For each sample size m, we ran each algorithm (Alg. 1 or uniform sampling) to construct a subset S = (S, v) of size m. We then trained the SVM model as per usual on this subset to obtain an optimal solution with respect to the coreset S, i.e., w * S = argmin w F λ (S, w). We then computed the relative error incurred by the solution computed on the coreset (w * S ) with respect to the ground-truth optimal solution computed on the entire data set   Fig. 1, we see that the coresets generated by our algorithm are much more representative and compact than the ones constructed by uniform sampling: across all data sets and sample sizes, training on our coreset yields significantly better solutions to SVM problem when compared to those generated by training on a uniform sample. For certain data sets, such as HTRU, Pathological, and W1, this relative improvement over uniform sampling is at least an order of magnitude better, especially for small sample sizes. Fig. 1 also shows that, as a consequence of a more informed sampling scheme, the variance of each model's performance trained on our coreset is much lower than that of uniform sampling for all data sets. Fig. 2 shows the total computational time required for constructing the subsample (i.e., coreset) S and training the SVM on the subset S to obtain w * S . We observe that our approach takes significantly less time than training on the original model when considering non-trivial data sets (i.e., n ≥ 18, 000), and underscores the efficiency of our method: we incur a negligible cost in the overall SVM training time due to a more involved coreset construction procedure, but benefit heavily in terms of the accuracy of the models generated (Fig. 1).
Next, we evaluate our approach in the streaming setting, where data points arrive one-by-one and the entire data set cannot be kept in memory, for the same 6 data sets. The results of the streaming setting are shown in Fig. 3  The relative error of query evaluations with respect uniform and coreset subsamples for the 6 data sets in the streaming setting. The figure shows that our method tends to fare even better in the streaming setting (cf. Fig. 1).
In sum, our empirical evaluations demonstrate the practical efficiency of our algorithm and reaffirm the favorable theoretical guarantees of our approach: the additional computational complexity of constructing the coreset is negligible relative to that of uniform sampling, and the entire preprocess-then-train pipeline is significantly more efficient than training on the original massive data set.

Conclusion
We presented an efficient coreset construction algorithm for generating compact representations of the input data points that are provably competitive with the original data set in training Support Vector Machine models. Unlike prior approaches, our method and its theoretical guarantees naturally extend to streaming settings and scenarios involving dynamic data sets, where points are continuously inserted and deleted. We established instance-dependent bounds on the number of samples required to obtain accurate approximations to the SVM problem as a function of input data complexity and established dataset dependent conditions for the existence of compact representations. Our experimental results on realworld data sets validate our theoretical results and demonstrate the practical efficacy of our approach in speeding up SVM training. We conjecture that our coreset construction can be extended to accelerate SVM training for other classes of kernels and can be applied to a variety of Big Data scenarios.

A Proofs of the Analytical Results in Section 5
This section includes the full proofs of the technical results given in Sec. 5.
A.1 Proof of Lemma 1 Lemma 1. For an even integer d ≥ 2, there exists a set of weighted points P = (P, u) such that Proof. Following [31], let n = d d/2 and let P = (P, u), where P ⊆ R d+1 × {±1} be set of n labeled points, and u : P → 1. For every p = (x, y) ∈ P , where x ∈ R d × {1} and y ∈ {±1}, among the first d entries of x, exactly d 2 entries are equivalent to where the remaining d 2 entries among the first d are set to 0. Hence, for our proof to hold, we assume that P contains all such combinations and at least one point of each label. For every p = (x, y) ∈ P , define the set of non-zero entries of p as the set Put p ∈ P and note that for bounding the sensitivity of point p, consider w with entries defined as Note that w . We also have that h(p, w) = 1 since y x, w = i∈Bp yx i w i = d 2 0 = 0. To bound the sum of hinge losses contributed by other points q ∈ P \ {p}, note that B q \ B p = ∅. Then for every q = (x , y ) = p, which implies that h(q, w) = 0. Thus, q∈P h(q, w) = 1.
Putting it all together, Since the above holds for every p ∈ P , summing the above inequality over every p ∈ P , yields that A.2 Proof of Lemma 2 Lemma 2. Let k be a positive integer, ξ ∈ [0, F λ (P, w * )], and let P = (P, u) be a weighted set. Then for every i ∈ [k], y ∈ {+, −} and p ∈ P Proof. Let P y ⊆ P denote the set of points with the same label as p as in Line 4 of Algorithm 1. Consider an optimal clustering of the points in P y into k clusters with centroids C y = {c Put p = (x, y) ∈ P and let i ∈ [k] be the index of the cluster which p belongs to, i.e., p ∈ P (i) y . We first observe that for any scalars a, b ∈ R, max{a − b, 0} ≤ max{a, 0} + max{−b, 0}. This implies that, by definition of the hinge loss, we have for every where [x] + = max{0, x} as before. Hence, in the context of the definitions above Now let the total weight of the points in P Applying the two inequalities established above to s(p)/u(p) yields that By definition of F λ (P \ P (i) y , w), we have Continuing from above and dividing both sides by λ yields Let be the expression on the right hand side of the sensitivity inequality above, and letŵ ∈ argmax w g(w). The rest of the proof will focus on bounding g(ŵ), since an upper bound on the sensitivity of a point as a whole would follow directly from an upper bound on g(ŵ).
Note that by definition of p ∆ and the embedding of 1 to the (d + 1) th entry of the original d-dimensional point (with respect to p), where the equality holds since the (d + 1)th entry of p ∆ is zero.
We know that ŵ, p ∆ ≥ α (i) y ŵ 1:d 2 2 ≥ 0, since otherwise g(ŵ) < 0, which contradicts the fact thatŵ is the maximizer of g(w). This implies that for each entry j ∈ [d] of the sub-gradient of g(·) evaluated atŵ, denoted by ∇g(ŵ), is given by and that ∇g(ŵ) d+1 = 0 since the bias term does not appear in the numerator of g(·).
Letting γ = ŵ, p ∆ − α (i) y ŵ 1:d 2 2 and setting each entry of the gradient ∇g(ŵ) to 0, we solve for p ∆ to obtain This implies that ŵ, p ∆ = γ ŵ, ∇F λ (P,ŵ) F λ (P,ŵ) + 2α (i) y ŵ 1:d 2 2 Rearranging and using the definition of γ, we obtain where Lemma 2 holds by taking 9 2 outside the max term. By using the same equivalency for p ∆ from above, we also obtain that , and so continuing from above, we have Solving for γ from the above equation yields forx > 0 Now we subdivide the rest of the proof into two cases. The first is the trivial case in which the sensitivity of the point is sufficiently small enough to be negligible, and the second case is the involved case in which the point has a high influence on the SVM cost function and its contribution cannot be captured by the optimal solution w * or something close to it.
Case g(ŵ) ≤ 3α (i) y the bound on the sensitivity follows trivially from the analysis above. Case g(ŵ) > 3α (i) y note that the assumption of this case implies that w * cannot be the maximizer of g(·), i.e.,ŵ = w * . This follows by the convexity of the SVM loss function which implies that the norm of the gradient evaluated at w * is 0. Thus by (15): Hence, we know that for this case we have ∇F λ (P,ŵ) 2 > 0, F λ (P,ŵ) > F λ (P, w * ) ≥ 0, and so we obtainx > 0. This implies that we can use Eq.(16) to upper bound the numerator γ of the sensitivity. Note that γ from (16) is decreasing as a function ofx, and so it suffices to obtain a lower bound onx. To do so, lets focus on Eq.(15) and let divide both sides of it by γ, to obtain that By rearranging the above equality, we have that Recall that since the last entry of p ∆ is 0 then it follows from Eq.(14) that ∇F λ (P,ŵ) d+1 is also zero, which implies that ŵ, ∇F λ (P,ŵ) = ŵ 1:d , ∇F λ (P,ŵ) 1:d ≤ ŵ 1:d 2 ∇F λ (P,ŵ) 1:d 2 where the inequality is by Cauchy-Schwarz.
Combining Eq.(17) with Eq. (18) yields where the second inequality holds by the assumption of the case, the third inequality follows from the fact that ŵ 1:d 2 2 ≤ 2F λ (P,ŵ). This implies that Hence by definition ofx, we have that Plugging Eq.(19) into Eq.(16), we obtain that which implies that where opt ξ = F λ (P,w) − ξ.
Combining both cases, yields that where Lemma 2 holds by rearranging Eq. 21.

A.3 Proof of Lemma 3
Lemma 3. In the context of Lemma 2, the sum of sensitivities is bounded by Proof. We first observe that that Thus we will focus on the summing the sensitivity of the all the points whose label is positive. We note that In addition, we observe that max {a, b} ≤ a + b for every a, b ≥ 0, which implies that for every i ∈ [k] and p ∈ P Since Hence by combining Eq.(22), Eq.(23), and Eq.(24), we yield that where the inequality follows from definition of α Since all of the previous arguments hold similarly for P − , we obtain that A.4 Proof of Theorem 1 Theorem 1. For any ε ∈ (0, 1/2), δ ∈ (0, 1), let m be an integer satisfying where t is as in Lem. 3. Invoking Coreset with the inputs defined in this context yields a ε-coreset S = (S, v) with probability at least 1 − δ in O (nd + T ) time, where T represents the computational complexity of obtaining an ξ-approximated solution to SVM and applying k-means++ on P + and P − .
Proof. By Lemma 2 and Theorem 5.5 of [7] we have that the coreset constructed by our algorithm is an ε-coreset with probability at least where we used the fact that the VC dimension of a SVMs in the case of a linear kernel is bounded dim(F) ≤ d+1 = O(d) [30], and c is a sufficiently large constant which can be determined using similar techniques to that of [19]. Moreover, note that the computation time of our algorithm is dominated by going over the whole weighted set P which takes O (n) and attaining an ξ-approximation to the SVM problem at Line 1 followed by applying k-means clustering as shown in Algorithm 1 which takes O (T ) time. This implies that the overall time is O (nd + T ).
Corollary 1. Let P be a weighted set, ε ∈ 0, 1 2 and let S be an ε-coreset with respect to P. Let w * S = argmin w∈R d+1 F λ (S, w) and let w * P be defined similarly with respect to P.
Proof. By Theorem 1, S = (S, v) is an ε-coreset for (P, u) with probability at least 1 − δ, which implies that where the first and third inequalities follow from (S, v) being an ε-coreset (see Definition 2), the second inequality holds by definition of w * S , and the last inequality follows from the assumption that ε ∈ 0, 1 2 .
Sufficient Conditions Theorem 1 immediately implies that, for reasonable ε and δ, coresets of poly-logarithmic (in n) size can be obtained if d = O(polylog(n)), which is usually the case in our target Big Data applications, and if For example, a value of λ ≤ log n n for the regularization parameter λ satisfies the sufficient condition for all data sets with points normalized such that they are contained within the unit ball. Note that the total sensitivity, which dictates how many samples are necessary to obtain an ε-coreset with probability at least 1 − δ and in a sense measures the difficulty of the problem, increases monotonically with the sum of distances of the points from their label-specific means.

B Extension to Streaming Settings
As a corollary to our main method, Alg. 2 extends the capabilities of any SVM solver, exact or approximate, to the streaming setting, where data points arrive one-by-one. Alg. 2 is inspired by [11,18] and constructs a binary tree, termed the merge-and-reduce tree, starting from the leaves which represent chunks of the data stream points. For each stream of l points, we construct an ε-coreset using Algorithm 1, and then we add each resulted tuple to B 1 , a bucket which is responsible for storing each of the parent nodes of the leaves (Lines 1-6).
Note that for every i > 1, the bucket B i will hold every node which is a root of a subtree of height i. Then, for every two successive items in each bucket B i , for every i ≥ 1, a parent node is generated by computing a coreset on the union of the coresets, which is then, added to the bucket B i+1 (Lines 7-11). This process is done till all the buckets are emptied other than B h , that will contain only one tuple (S, v) which is set to be the root of the merge-and-reduce tree.
In sum, we obtain a binary tree of height h = Θ(log(n)) for a stream of n data points. Thus, at Lines 4 and 10, we have used error parameter ε = ε/(2 log(n)) and failure parameter δ = δ/(2 log(n)) in order to obtain ε-coreset with probability at least 1 − δ. Setũ : T1 ∪ T2 → [0, ∞) such that for every p ∈ T1 ∪ T2, u(p) = u1(p) p ∈ T1, u2(p) otherwise ; 10 Coreset construction of size poly-logarithmic in n. In case of the total sensitivity being sub-linear in n where n denotes the number of points in P , which is obtained by Lemma 2, we provide the following theorem which constructs a (1 + ε)-coreset of size poly-logarithmic in n.
Proof. First we note that using Theorem 1 on each node in the merge-and-reduce tree, would attain that the root of the tree, i.e., (S, v) attains that for every w with probability at least (1 − δ) log n . We observe by the properties of the natural number e, (1 + ε) log n = 1 + ε log n log n log n ≤ e ε log n , which when replacing ε with ε = ε 2 log n in the above inequality as done at Lines 4 and 10 of Algorithm 2, we obtain that where the inequality holds since ε ∈ [ 1 log n , 1 2 ]. As for the lower bound, observe that where the inequality holds since ε ∈ [ 1 log n , 1 2 ]. Hence, Similar arguments holds also for the failure probability δ. What is left for us to do is setting the leaf size which will attain us an ε-coreset of size poly-logarithmic in n (the number of points in P ).
Let ∈ (0, ∞) be the size of a leaf in the merge-and-reduce tree. We observe that a coreset of size poly-logarithmic in n, can be achieved by solving the inequality which is invoked when ascending from any two leafs and their parent node at the merge-and-reduce tree.
Rearranging the inequality, we yield that Since ∈ (0, ∞), any ≥ 1−β √ 2 β would be sufficient for the inequality to hold. What is left for us to do, is to show that when ascending through the merge-and-reduce tree from the leaves towards the root, each parent node can't be more than half of the merge of it's children (recall that the merge-and-reduce tree is built in a binary tree fashion, as depicted at Algorithm 2).
Thus, we need to show that, holds, for any i ∈ [ log n ] where log n is the height of the tree. Note that the left most term is the parent node's size and the right most term represents half the size of both parent's children nodes. In addition, for i = 1, the inequality above represents each node which is a parent of leaves. Thus, we observe that for every i ≥ 1, the inequality represents ascending from node which is a root of a sub-tree of height i − 1 to it's parent in the merge-and-reduce tree.
By simplifying the inequality, we obtain the same inequality which only addressed the leaves. Hence, by using any ≥ 2 β 1−β as a leaf size in the merge and reduce tree, we obtain an ε-coreset of size poly-logarithmic in n.

C The logic behind applying k-means clustering
First put in mind the bound from Lemma 2, and note that it was achieved by using k-means++ clustering as depicted at Algorithm 1. Following our analysis from Sec. A.2, we observe that we can simply use any k-partitioning of the dataset, instead of applying k-means clustering. Moreover, we can also simply choose k = 1 which translates to simply taking the mean of the labeled points. Despite all of above, we did choose to use a clustering algorithm as well as having larger values for k and such decisions were inspired by the following observations: (i) k-means clustering aims to optimize the sum of squared distances between the points and their respected center, which on some level, helps in lowering the distance between points and their respected centers. Such observation leads to having tighter bound for the sensitivity of each point, consequently leading to lower coreset sizes; See Thm. 1. (ii) Having larger k also helps lowering the distance between a point and its respected center. (iii) k-means clustering acts as a trade-off mechanism between • the raw contribution of each point, which is translated into the weight of the point divided by the sum of the weights with respect to the cluster that each point is assigned to, • and the actual contribution of each point which is translated to the distance between each point and its respected center.
(a) At first, an optimal solution for the SVM problem is found.
(b) We focus on the the positive labeled points (blue points) and we find a k-means clustering using k-means++, where we set k = 3. The yellow points are the centers found by the k-means++ algorithm (c) Points in small clusters have higher sensitivities, which quantifies the importance of outliers and misclassified points as they will be mostly in small clusters as k goes larger. In light of the above, we observe that as k goes larger, the sensitivity of each point gets closer and closer to being simply the raw contribution, which in case of unweighted data set, is simply applying uniform sampling. Thus, for each weighted (P, u), we simply chose k = log n where n denotes the total number of points in a P .
This observation helps in understanding how the sensitivities that we are providing for outliers and misclassified points actually quantifies the importance of such points. specifically speaking, as k goes larger the outliers would mostly be assigned to the same cluster and since in general there aren't much of these points, we end up giving higher sensitivities for such points (than others) due to the fact that their raw contribution increases as the size of the cluster, they belong to, decreases. When k isn't large enough to separate these points from the rest of the data points, then the actual contribution kicks into play, which then the mean of the cluster is shifted towards the "middle" between the outliers and the rest of the points in that cluster, boosting the actual contribution of the rest of points inside the same cluster; See Fig. 4 C.1 Towards finding the best k value In the context of clustering, specifically speaking, k-means clustering problem, there is no definitive, provable way for determining the best k value, while considering the computation cost needed for applying the k-means algorithm (or alternatively k-means++). However, there are some tools which can point to the best k value from a heuristic's point of view. Such tools include the Silhouette Method and the Elbow Method. Fortunately enough, in our context, using the same methods can aid us in finding a "good" trade-off between the raw contribution and the actual contribution.
Although, such methods are proven to be useful in practice [17], in our experiments, we simply chosen a constant value for k depending on the number of points in the data set as elaborated in Section 6, and section D, which is shown to be useful in practice at Figure 1 and Figure 3.

D Experimental Details
Our experiments were implemented in Python and performed on a 3.2GHz i7-6900K (8 cores total) machine with 64GB RAM. We considered the following datasets in our evaluations.
Preprocessing step. Each data set has gone through a standardization process which aims to rescale the features so that they will have zero mean and unit standard deviation. As for the case where a data set is unweighted, we simply give each data point a weight of 1, i.e., u : P → 1 where P denotes the data set, and the regularization parameter λ was set to be 1 throughout all of our experiments.
k-means clustering. In our experiments, we set k = log n where n is the number of points in the dataset (each datasets has different k value). As for the clustering itself, we have applied k-means++ [3] on each of P + and P − as stated in our analysis; see Sec. 5.
Evaluation under streaming setting. Under streaming setting, the range for sample sizes is the same as for running under offline settings (See Figures 1 and 2). What differs is the quality of the solver itself, which we use to show the effectiveness of our coreset compared to uniform sampling, i.e., we have chosen to make the solver (SVC of Sklearn) more accurate by lowering its optimal tolerance.