{'fraction_non_alphanumeric': 0.043021539160389144, 'fraction_numerical': 0.016750577279781957, 'mean_word_length': 4.010906676783004, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
S2: An Efficient Graph Based Active Learning Algorithm with Application to Nonparametric Classification

This paper investigates the problem of active learning for binary label prediction on a graph. We introduce a simple and label-efficient algorithm called S2 for this task. At each step, S2 selects the vertex to be labeled based on the structure of the graph and all previously gathered labels. Specifically, S2 queries for the label of the vertex that bisects the *shortest shortest* path between any pair of oppositely labeled vertices. We present a theoretical estimate of the number of queries S2 needs in terms of a novel parametrization of the complexity of binary functions on graphs. We also present experimental results demonstrating the performance of S2 on both real and synthetic data. While other graph-based active learning algorithms have shown promise in practice, our algorithm is the first with both good performance and theoretical guarantees. Finally, we demonstrate the implications of the S2 algorithm to the theory of nonparametric active learning. In particular, we show that S2 achieves near minimax optimal excess risk for an important class of nonparametric classification problems.


Introduction
This paper studies the problem of binary label prediction on a graph. We suppose that we are given a graph over a set of vertices, where each vertex is associated with an initially unknown binary label. For instance, the vertices could represent objects from two classes, and the graph could represent the structure of similarity of these objects. The unknown labels then indicate the class that each object belongs to. The goal of the general problem of binary label prediction on a graph is to predict the label of all the vertices given (possibly noisy) labels for a subset of the vertices. Obtaining this initial set of labels could be costly as it may involve consulting human experts or expensive experiments. It is therefore of considerable interest to minimize the number of vertices whose labels need to be revealed before the algorithm can predict the remaining labels accurately. In this paper, we are especially interested in designing an active algorithm for addressing this problem, that is, an algorithm that sequentially and automatically selects the vertices to be labeled based on both the structure of the graph and the previously gathered labels. We will now highlight the main contributions of the paper: • A new active learning algorithm which we call S 2 . In essence, S 2 , which stands for shortest shortest path operates as follows. Given a graph and a subset of vertices that have been labeled, S 2 picks the mid-point of the path of least length among all the shortest paths connecting oppositely labeled vertices. As we will demonstrate in Sec 4, S 2 automatically adapts itself to a natural notion of the complexity of the cut-set of the labeled graph.
• A novel complexity measure. While prior work on graph label prediction has focused only on the cut-size (i.e., the number of edges that connect oppositely labeled nodes) of the labeling, our refined complexity measure (cf. Section 4.1) quantifies the difficulty of learning the cut-set. Roughly speaking, it measures how clustered the cut-set is; the more clustered the cut-set, the easier it is to find. This is analogous to the fact that the difficulty of classification problems in standard settings depends both on the size and the complexity of the Bayes decision boundary.
• A practical algorithm for non-parametric active learning. Significant progress has been made in terms of characterizing the theoretical advantages of active learning in nonparametric settings (e.g., Castro and Nowak [2008], Hanneke [2011], Koltchinskii [2010], Minsker [2012], Wang [2011]), but most methods are not easy to apply in practice. On the other hand, the algorithm proposed in Zhu et al. [2003b], for example, offers a flexible approach to nonparametric active learning that appears to provide good results in practice. It however does not come with theoretical performance guarantees. A contribution of our paper is to fill the gap between the practical method of Zhu et al. [2003b] and the theoretical work above. We show that S 2 achieves the minimax rate of convergence for classification problems with decision boundaries in the so-called box-counting class (see Castro and Nowak [2008]). To the best of our knowledge this is the first practical algorithm that is minimax-optimal (up to logarithmic factors) for this class of problems.

Related Work
Label prediction on the vertices of a graph is an important and challenging problem. Many practical algorithms have been proposed for this (e.g., Blum and Chawla [2001], Blum et al. [2004], Dasgupta and Hsu [2008], Zhu et al. [2003a]), with numerous applications such as information retrieval [Joachims, 2003] and learning intracellular pathways in biological networks [Chasman et al., 2009], among others. Theoretically, however, a complete understanding of this problem has remained elusive. In the active learning version of the problem there even appears to be contradictory results with some supporting the benefit of active learning [Afshani et al., 2007, Dasgupta andHsu, 2008] while others being pessimistic [Cesa-Bianchi et al., 2010]. In this paper, we propose a new and simple active learning algorithm, S 2 , and examine its performance. Our theoretical analysis of S 2 , which utilizes a novel parametrization of the complexity of labeling functions with respect to graphs, clearly shows the benefit of adaptively choosing queries on a broad class of problems. The authors in Cesa-Bianchi et al. [2010] remark that "adaptive vertex selection based on labels" is not helpful in worst-case adversarial settings. Our results do not contradict this since we are concerned with more realistic and non-adversarial labeling models (which may be deterministic or random). Adaptive learning algorithms for the label prediction on graphs follow one of two approaches. The algorithm can either (i) choose all its queries upfront according to a fixed design based on the structure of the graph without observing any labels (e.g., in Cesa-Bianchi et al. [2010], Gu and Han [2012]), or (ii) pick vertices to query in a sequential manner based on the structure of the graph and previous collected labels (e.g., Afshani et al. [2007], Zhu et al. [2003b) 1 . The former is closely related to experimental design in statistics, while the latter is adaptive and more akin to active learning; this is the focus of our paper.
Another important component to this problem is using the graph structure and the labels at a subset of the vertices to predict the (unknown) labels at all other vertices. This arises in both passive and active learning algorithms. This is a well-studied problem in semi-supervised learning and there exist many good methods [Blum and Chawla, 2001, Gu and Han, 2012, Zhou et al., 2004, Zhu et al., 2003a. The focus of our paper is the adaptive selection of vertices to label. Given the subset of labeled vertices it generates, any of the existing methods mentioned above can be used to predict the rest.
The main theoretical results of our paper characterize the sample complexity of learning the cut-set of edges that partition the graph into disjoint components corresponding to the correct underlying labeling of the graph. The work most closely related to the focus of this paper is Afshani et al. [2007], which studies this problem from the perspective of query complexity [Angluin, 2004]. Our results improve upon those in Afshani et al. [2007]. The algorithm we propose is able to take advantage of the fact that the cut-set edges are often close together in the graph, and this can greatly reduce the sample complexity in theory and practice.
Finally, our theoretical analysis of the performance of S 2 quantifies the number of labels required to learn the cut-set and hence the correct labeling of the entire graph. It does not quantify the number of labels needed to achieve achieve a desired nonzero (Hamming) error level. To the best of our knowledge, there are no algorithms for which there is a sound characterization of the Hamming error. Using results from Guillory andBilmes [2009], Cesa-Bianchi et al. [2010] takes a step in this direction but their results are valid only for trees. For more general graphs, such Hamming error guarantees are unknown. Nonetheless, learning the entire cut-set induced by a labeling guarantees a Hamming error of zero, and so the two goals are intimately related.

Preliminaries and Problem Setup
We will write G = (V, E) to denote an undirected graph with vertex set V and edge set E. Let f : V → {−1, +1} be a binary function on the vertex set. We call f (v) the label of v ∈ V . We will further suppose that we only have access to the labeling function f through a (potentially) noisy oracle. That is, fixing γ ∈ (0, 0.5], we will assume that for each vertex v ∈ V , the oracle returns a random variablef (v) such thatf (v) equals −f (v) with probability γ and equals f (v) with probability 1 − γ, independently of any other query submitted to this oracle. We will refer to such an oracle as a γ−noisy oracle. The goal then is to design an algorithm which sequentially selects a multiset 2 of vertices L and uses the labels f (v), v ∈ L to accurately learn the true labeling function f . Since the algorithm we design will assume nothing about the labeling, it will be equipped to handle even an adversarial labeling of the graph. Towards this end, if we let C denote the cut-set of the labeled graph, i.e., C {{x, y} ∈ E : f (x) = f (y)} and let ∂C denote the boundary of the cut-set, i.e., ∂C = {x ∈ V : ∃e ∈ C with x ∈ e}, then our goal will actually be to identify ∂C.
Of course, it is of interest to make L as small as possible. Given ∈ (0, 1), the number of vertices that an algorithm requires the oracle to label, so that with probability at least 1 − the algorithm correctly learns f will be referred to as its −query complexity. We will now show that given an algorithm that performs well with a noiseless oracle, one can design an algorithm that performs well on a γ−noisy oracle.
Proposition 1. Suppose A is an algorithm that has access to f through a noiseless oracle, and suppose that it has a −query complexity q, then for each γ ∈ (0, 0.5), there exists an algorithmÃ which, using a γ−noisy oracle achieves a 2 −query complexity given by q × 1 2(0.5−γ) 2 log n .
The main idea behind this proposition is that one can build a noise-tolerant version of A by repeating each query that A requires many times, and using the majority vote. The proof of Proposition 1 is then a straightforward application of Chernoff bounds and we defer it to Appendix A.
Therefore, to keep our presentation simple, we will assume in the sequel that our oracle is noiseless. A more nuanced treatment of noisy oracles is an interesting avenue for future work.
It should also be noted here that the results in this paper can be extended to the multi-class setting, where f : V → {1, 2, . . . , k} by the standard "one-vs-rest" heuristic (see e.g., Bishop et al. [2006]). However, a thorough investigation of the multiclass classification on graphs is an interesting avenue for future work.

The S 2 algorithm
The name S 2 signifies the fact that the algorithm bisects the shortest shortest-path connecting oppositely labeled vertices in the graph. As we will see, this allows the algorithm to automatically take advantage of the clusteredness of the cut set. Therefore, S 2 "unzips" through a tightly clustered cut set and locates it rapidly (see Figure 1).
The algorithm works by first constructing a label set L ⊂ V sequentially and adaptively and then using the labels in L to predict the labels of the vertices in V \ L. It accepts as input a natural number BUDGET, which is the query budget that we are given to complete the learning task. In 2 A multiset is a set that may contain repeated elements.  Add (x, f (x)) to L

6:
Remove from G all edges whose two ends have different labels. while x ← MSSP(G, L) exists 11: end while our theoretical analysis, we will show how big this budget needs to be in order to perform well on a wide variety of problems. Of course this budget specification merely reflects the completely agnostic nature of the algorithm; we subsequently show (see Section 3.1) how one might factor in expert knowledge about the problem to create more useful stopping criteria.
S 2 (Algorithm 1) accepts a graph G and a natural number BUDGET. Step 3 performs a random query. In step 6, the obvious cut edges are identified and removed from the graph. This ensures that once a cut edge is found, we do not expend more queries on it. In step 7, the algorithm ensures that it has enough budget left to proceed. If not, it stops querying for labels and completes the labeling using the subroutine LABELCOMPLETION. In step 10, the mid-point of the shortest shortest path is found using the MSSP subroutine (Subroutine 2) and the algorithm proceeds till there are no more mid-points to find. Then, the algorithm performs another random query and the above procedure is repeated. As discussed in Proposition 1, if in Step 5, we compute f (x) as the majority label among O (log(n/ )) repeated queries about the label of x, then we get a noise tolerant version of S 2 .
We will now describe the sub-routines used by S 2 . Each of these accepts a graph G and a set L of vertices. LABELCOMPLETION(G, L) is any off-the-shelf procedure that can complete Return mid-point of P i * j * (break ties arbitrarily). 8: else 9: Return ∅ 10: end if the labeling of a graph from a subset of labels. This could, for instance, be the graph min-cut procedure Blum and Chawla [2001] or harmonic label propagation Zhu et al. [2003a]. Since, we endeavor to learn the entire cut boundary, we only include this sub-routine for the sake of completeness so that the algorithm can run with any given budget. Our theoretical results do not depend on this subroutine. MSSP(G, L) is Subroutine 2 and finds the midpoint on the shortest among all the shortest-paths that connect oppositely labeled vertices in L. If none exist, it returns ∅.
The main idea underlying the S 2 algorithm is the fact that learning the labeling function f amounts to locating all the cut-edges in the labeled graph. Conceptually, the algorithm can be thought of as operating in two phases: random sampling and aggressive search. In the random sampling phase, the algorithm queries randomly chosen unlabeled vertices until it finds two vertices with opposite labels. Then our algorithm enters the aggressive search phase. It picks the shortest path between these two points and bisects it. What our algorithm does next sets it apart from prior work such as Afshani et al. [2007]. It does not run each binary search to the end, but merely keeps bisecting the shortest among all the shortest paths that connect oppositely labeled vertices observed so far. This endows the algorithm with the ability to "unzip" cut boundaries. Consider a sample run shown in Figure 1. The random sampling phase first picks a set of random vertices till an oppositely labeled pair is observed as in Figure 1(a). The shortest shortest path connecting oppositely labeled nodes is shown here as a thick sequence of edges. Figure 1(b) shows that S 2 now bisects shortest shortest paths and subsequently finds a cut-edge. The bisection of the next two shortest shortest paths is shows in Figure 1(c) and we see the boundary unzipping feature of the algorithm emerges. Figure 1(d) finally shows the situation after the completion of the algorithm. Notice that an extremely small number of queries are used before S 2 completely discovers the cut boundary.

Stopping Criterion
Notice S 2 stops only if the budget is exhausted. This stopping criterion was chosen for two main reasons. Firstly, this keeps the presentation simple and reflects the fact that S 2 assumes nothing about the underlying problem. In practice, extra information about the problem can be easily incorporated. For instance, suppose one knows a bound on the cut-set or on the size of similarly labeled connected components, then such criteria can be used in Step 7. Similarly, one can hold out a random subset of observed labels and stop upon achieving low prediction error on this subset. Secondly, in our theoretical analysis, we show that as long as the budget is large enough, then S 2 recovers the cut boundary exactly. The larger the budget is, the more complex the graphs and labelings S 2 can handle. Therefore, our result can be interpreted as a quantification of the complexity of a natural class of graphs. In that sense S 2 is not only an algorithm but a tool for exposing the theoretical challenges of label prediction on a graph.

Analysis
Let C and ∂C be as defined in Section 2. As we observed earlier, the problem of learning the labeling function f is equivalent to the problem of locating all the cut edges in the graph. Clearly, if f could be arbitrary, the task of learning f given its value on a subset of its domain is ill-posed. However, we can make this problem interesting by constraining the class of functions that f is allowed to be in. Towards this end, in the next section we will discuss the complexity of a labeling function with respect to the underlying graph.

Complexity of the Labeling Function with respect to the Graph
We will begin by making a simple observation. Given a graph G and a labeling function f , notice that f partitions the vertices of the graph into a collection of connected components with identically labeled vertices. We will denote these connected components as V 1 , V 2 , . . . , V k , where k represents the number of connected components.
Then, the above partitioning of the vertex set induces a natural partitioning of the cut set C = 1≤r<s≤k C rs , where C rs = {x, y ∈ C : x ∈ V r , y ∈ V s }. That is, C rs contains the cut edges whose boundary points are in the components V r and V s 3 . We denote the number of non-empty subsets C rs by m, and we call each non-empty C rs a cut component. See Figure 2(a) for an illustration. It shows a graph, its corresponding labeling (denoted by darker and lighter colored vertices) and the cut set (thickened lines). It also shows the induced vertex components V 1 , V 2 , V 3 and the corresponding cut components C 12 and C 23 . We will especially be interested in how clustered a particular cut component is. For instance, compare the cut component C 12 between Figures 2(a) and 2(b). Intuitively, it is clear that the former is more clustered than the latter. As one might expect, we show that it is easier to locate well-clustered cut components.
We will now introduce three parameters which, we argue, naturally govern the complexity of a particular problem instance. Our main results will be expressed in terms of these parameters.
1. Boundary Size. The first and the most natural measure of complexity we consider is the size of the boundary of the cut set |∂C|. It is not hard to see that a problem instance is hard if the boundary size induced by the labeling is large. In fact, |∂C| is trivially a lower bound on the total number of queries needed to learn the location of C. Conversely, if it is the case that well-connected vertices predominantly have the same label, then |∂C| will most likely be small. Theorem 1 will show that the number of queries needed by the S 2 algorithm scales approximately linearly with |∂C|.
2. Balancedness. The next notion of label complexity we consider is the balancedness of the labeling. As we discussed above, the labeling function induces a partition on the vertex set V 1 , V 2 , . . . , V k . We will define the balancedness of f with respect to G as β min 1≤i≤k It is not hard to see why balancedness is a natural way of quantifying problem complexity. If there is a very small component, then without prior knowledge, it will be unlikely that we see labeled vertices from this component. We would then have no reason to assign labels to its vertices that are different from its neighbors. Therefore, as we might expect, the larger the value of β, the easier it is to find a particular labeling (see Lemma 1 for more on this).
3. Clustering of Cut Components. We finally introduce a notion of complexity of the labeling function which, to the best of our knowledge, is novel. As we show, this complexity parameter is key to developing an efficient active learning algorithm for general graphs. Let is the the length of the shortest path connecting x and y in G with the convention that the distance is ∞ if x and y are disconnected. Using this, we will define a metric δ : where G − C is the graph G with all the cut-edges removed. Notice that δ is a metric on C and that δ(e 1 , e 2 ) < ∞ if and only if e 1 and e 2 lie in the same cut-component.
Imagine a scenario where a cut-component C rs is such that each pair e, e ∈ C rs satisfy δ(e, e ) ≤ κ. Now, suppose that the end points of one of the cut-edges e 1 ∈ C rs has been discovered. By assumption, each remaining cut-edge in C rs lies in a path of length at most κ from a pair of oppositely labeled vertices (i.e., the end points of e 1 ). Therefore, if one were to do a bisection search on each path connecting these oppositely labeled vertices, one can find all the cut-edges using no more that |C rs | log κ queries. If κ is small, this quantity could be significantly smaller than n (which is what an exhaustive querying algorithm would do). The reason for the drastically reduced query complexity is the fact that the cut-edges in C rs are tightly clustered. A generalization of this observation gives rise to our third notion of complexity.
Let H r = (C, E) be a "meta graph" whose vertices are the cut-edges of G and {e, e } ∈ E iff δ(e, e ) ≤ r, i.e., H r is the r-nearest neighbor graph of the cut-edges, where distances are defined according to δ. From the definition of δ, it is clear that for any r ∈ N, H r has at least m connected components.
Definition 1. A cut-set C is said to be κ−clustered if H κ has exactly m connected components. These connected components correspond to the cut-components, and we will say that each individual cut-component is also κ-clustered.
Turning back to Figure 2, observe that the cut component C 12 is κ-clustered for any κ ≥ 5 in Figure 2(a) and κ−clustered for any κ ≥ 12 in Figure 2(b). The figure also shows a length 5 (resp. 12) path in Fig 2(a) (resp. Fig 2(b)) that defines the clusteredness.
Figure 2: Two graphs with the same number of cut-edges (thickened edges) but the cut component C 12 in (a) is more "clustered" than its counterpart in (b). C 12 is 5-clustered in (a) and 12-clustered in (b). The corresponding length κ paths are shows with a (red) dotted line.

The query complexity of S 2
In this section, we will prove the following theorem.
Theorem 1. Suppose that a graph G = (V, E) and a binary function f are such that the induced cut set C has m cut components that are each κ−clustered. Then for any > 0, S 2 will recover C with probability at least 1 − if the BUDGET is at least Before we prove the theorem, we will make some remarks: 1. As observed in Afshani et al. [2007], using O(|∂C|) queries, we can create a greedy cover of the graph and reduce the length of the longest binary search from n to O n |∂C| . With this simple modification to S 2 , the log 2 n in (1) can be replaced by log(n/ |∂C|).
2. Suppose that G is a √ n × √ n grid graph where one half of this graph, i.e., a √ n × √ n/2 rectangular grid, is labeled +1 and the other half −1. In this case, since m = 1, |∂C| = O( √ n) and κ = 3, Theorem 1 says that S 2 needs to query at most O( √ n + log n) vertices. This is much smaller than the bound of O ( √ n log n) which can be obtained using the results of Afshani et al. [2007].
In fact, when κ < n/|∂C|, it is clear that for m ≥ 1, m log(n/|∂C|) + (|∂C| − m) log κ < |∂C| log(n/|∂C|), i.e., our bounds are strictly better than those in Afshani et al. [2007] 3. As discussed in Section 2, the number of queries the (i.i.d) noise tolerant version of S 2 submits can be bounded by the above quantity times 1 2γ 2 log n and is guaranteed to recover C exactly with probability at least 1 − 2 .
4. The first term in (1) is due to random sampling phase which can be quite large if β is very small. Intuitively, if V i is a very small connected component, then one might have to query almost all vertices before one can even obtain a label from V i . Therefore, the "balanced" situation, where β is a constant independent of n, is ideal here. These considerations come up in Afshani et al. [2007] as well, and in fact their algorithm needs a priori knowledge of β. Such balancedness assumptions arise in various other lines of work as well (e.g., Balakrishnan et al. [2011], Eriksson et al. [2011]). Finally, we remark that if one is willing to ignore errors made on small "outlier" components, then β can be redefined in terms of only the sufficiently large V i 's. This allows us to readily generalize our results to the case where one can approximately recover the labeling of the graph.
5. As we argue in Appendix D, S 2 is near optimal with respect to the complexity parametrization introduced in this paper. That is, we show that there exists a family of graphs such that no algorithm has significantly lower query complexity than S 2 . It will be interesting to investigate the "instanceoptimality" property of S 2 , where we fix a graph and then ask if S 2 is near optimal in discovering labelings on this graph. We take a step in this direction in Appendix D.2 and show that for the 2-dimensional grid graph, the number of queries made by S 2 is near optimal.
Proof. of Theorem 1 We will begin the proof with a definition and an observation. Recall (from Section 4.1) that the labeling function partitions the vertex set into similarly labeled components V 1 , . . . , V k . Suppose that W ⊂ V is such that for each i ∈ {1, 2, . . . , k}, |W ∩ V i | ≥ 1. Then, it follows that for each e ∈ C, there exists a pair of vertices v, v in W such that f (v) = f (v ) and e lies on a path joining v and v . We call such a set a witness to the cutset C. Since ∂C is a witness to the cut-set C, it is clearly necessary for any algorithm to know the labels of a witness to the cut set C in order to learn the cut set. Now, as described in Section 3, the operation of S 2 consists of two phases -(a) the random sampling phase and (b) the aggressive search phase. Observe that if S 2 knows the labels of a witness to the cut component C rs , then, until it discovers the entire cut-component, S 2 remains in the aggressive search phase. Therefore, the goal of the random sampling phase is to find a witness to the cut set. This implies that we can bound from above the number of random queries S 2 needs before it can locate a witness set, and this is done in the following lemma.
Lemma 1. Consider a graph G = (V, E) and a labeling function f with balancedness β. For all α > 0, a subset L chosen uniformly at random is a witness to the cut-set with probability at least 1 − α, as long as .
We refer the reader to Appendix B for the proof which is a straightforward combinatorial argument.
Of course, since the random sampling phase and the aggressive search phase are interleaved, S 2 might end up needing far fewer random queries before a witness W to the cut-set has been identified. Now, we will turn our attention to the aggressive search phase. The algorithm enters the aggressive search phase as soon there are oppositely labeled vertices that are connected (recall that the algorithm removes any cut-edge that it finds). Let S 2 (G, L, f ) be the length of the shortest among all shortest paths connecting oppositely labeled vertices in L, and we will suppress this quantity's dependence on G, L, f when the context is clear. After each step of the aggressive search phase, the shortest shortest paths that connect oppositely labeled vertices gets bisected. Suppose that, during this phase, the current shortest path length is S 2 = ∈ N. Then depending on its parity, after one step S 2 gets updated to +1 2 (if is odd) or 2 (if is even). Therefore, we have the following result .
Claim 1. If S 2 = , after no more than r = log 2 + 1 aggressive steps, a cut-edge is found.
Proof. First observe that after r steps of the aggressive search phase, the length of the shortest shortest path is no more than +2r−1 2 r . Next, observe that if r ≥ 4, then 2 r−1 ≤ 2 r − 2r + 1. The proof of this claim then follows from the following observation. Let us first suppose that ≥ 8, then setting r = log 2 + 1, we have that ≤ 2 r−1 ≤ 2 r − 2r + 1, which of course implies that +2r−1 2 r ≤ 1. Therefore, after at most r steps, the current shortest shortest path length drops to below 1, i.e., a cut-edge will be found. For the case when < 8, one can exhaustively check that this statement is true.
It is instructive to observe two things here: (a) even though S 2 gets (nearly) halved after every such aggressive step, it might not correspond to the length of a single path through the span of the above r steps, and (b) at the end of r aggressive steps as above, at least one new boundary vertex is found, therefore, the algorithm might end up uncovering multiple cut-edges after r steps.
To bound the number of active queries needed, let us split up the aggressive search phase of S 2 into "runs", where each run ends when a new boundary vertex has been discovered, and commences either after the random sampling phase exposes a new path that connects oppositely labeled vertices or when the previous run ends in a new boundary vertex being discovered. Let R be the total number of runs. Notice that R ≤ |∂C|. For each i ∈ R, let G i and L i denote the graph and the label set at the start of run i. Therefore, by Claim 1, the total number of active learning queries needed can be upper bounded by i∈R { log 2 ( S 2 (G i , L i , f )) + 1}. Now, observe that for each run in i ∈ R, it trivially holds that S 2 (G i , L i , f ) ≤ n ¶ . Now suppose that one cut-edge is discovered in a cut-component C rs . Since the graph on C rs induced by H κ is κ-connected by the assumption of the theorem, until all the cut-edges are discovered, there exists at least one undiscovered cut-edge in C rs that is at most κ away (in the sense of δ) from one of the discovered cut-edges. Therefore, S 2 is no more than κ until all cuts in C rs have been discovered. In other words, for |C rs | − 1 runs in R, S 2 ≤ κ.
Reasoning similarly for each of the m cut components, we have that there are no more than m "long" runs (one per cut-component) and we will bound S 2 for these runs by n. From the argument above, after an edge from a cut-component has been found, S 2 is never more than κ till all the edges of the cut-component are discovered. Therefore, we have the following upper bound ¶ As in the Remark 1 after the statement of the theorem, this can be improved to O (n/ |∂C|) using a greedy cover of the graph [Afshani et al., 2007]. on the number of aggressive queries needed. i∈R { log 2 ( S 2 (G i , L i , f )) + 1} ≤ |∂C| + m log 2 n + (|∂C| − m) log 2 κ = m ( log 2 n − log 2 κ ) + |∂C| ( log 2 κ + 1) Putting this together with the upper bound on the number of random queries needed, we get the desired result.

S 2 for Nonparametric Learning
Significant progress has been made in terms of characterizing the theoretical advantages of active learning in nonparametric settings. For instance, minimax rates of convergence in active learning have been characterized under the so called boundary fragment assumption [Castro and Nowak, 2008, Minsker, 2012, Wang, 2011. This model requires the Bayes decision boundary to have a functional form. For example, if the feature space is [0, 1] d , then the boundary fragment model assumes that the Bayes decision boundary is defined by a curve of the form x d = f (x 1 , . . . , x d−1 ), for some (smooth) function f . While such assumptions have proved useful for theoretical analysis, they are unrealistic in practice. Nonparametric active learning has also been analyzed in terms of abstract concepts such as bracketing and covering numbers [Hanneke, 2011, Koltchinskii, 2010, but it can be difficult to apply these tools in practice as well. The algorithm proposed in Zhu et al.
[2003b] offers a flexible approach to nonparametric active learning that appears to provide good results in practice, but comes with no theoretical performance guarantees. A contribution of our paper is to fill the gap between the practical method of Zhu et al. [2003b] and the theoretical work above. The S 2 algorithm can adapt to nonparametric decision boundaries without the unrealistic boundary fragment assumption required by Castro and Nowak [2008], for example. We show that S 2 achieves the minimax rate of convergence for classification problems with decision boundaries in the so-called box-counting class, which is far less restrictive than the boundary fragment model. To the best of our knowledge this is the first practical algorithm that is near minimax-optimal for this class of problems.

Box-Counting Class
Consider a binary classification problem on the feature space [0, 1] d , d ≥ 1. The box-counting class of decision boundaries generalizes the set of boundary fragments with Lipschitz regularity to sets with arbitrary orientations, piecewise smoothness, and multiple connected components. Thus, it is a more realistic assumption than boundary fragments for classification; see Scott and Nowak [2006] for more details. Let w be an integer and let P w denote the regular partition of [0, 1] d into hypercubes of side length 1/w. Every classification rule can be specified by a set B ⊂ [0, 1] d on which it predicts +1. Let N w (B) be the number of cells in P w that intersect the boundary of B, denoted by ∂B. For c 1 > 0, define the box-counting class B BOX (c 1 ) as the collection of all sets B such that N w (B) ≤ c 1 w d−1 for all (sufficiently large) w.

Problem Set-up
Consider the active learning problem under the following assumptions.

A1
The Bayes optimal classifier B * resides in B BOX (c 1 ). The corresponding boundary ∂B * divides [0, 1] d into k connected components 6 (each labeled either +1 or −1) and each with volume at least 0 < β < 1. Furthermore, the Hausdorff distance between any two components with the same label is at least ∆ 1 > 0.
A2 The marginal distribution of features P (X = x) is uniform over [0, 1] d (the results can be generalized to continuous distributions bounded away from zero).
A3 The conditional distribution of the label at each feature is bounded away from 1/2 by a positive margin; i.e., |P It can be checked that the set of distributions that satisfy A1-A3 contain the set of distributions BF(1, 1, C 1 , 0, γ) from Castro and Nowak [2008].
Let G denote the regular square lattice on [0, 1] d with w vertices equispaced in each coordinate direction. Each vertex is associated with the center of a cell in the partition P w described above. Figure 3 depicts a case where d = 2, w = 15 and k = 2, where the subset of vertices contained in the set B * is indicated in red. The minimum distance ∆ 1 in A1 above ensures that, for w sufficiently large, the lattice graph also consists of exactly k connected components of vertices having the same label. S 2 can be used to solve the active learning problem by applying it to the lattice graph associated with the partition P w . In this case, when S 2 requests a (noisy) label of a vertex of G, we randomly draw a feature from the cell corresponding to this vertex and return its label.

Near Minimax Optimality of S 2 .
The main result of this section shows that the excess risk of S 2 for the nonparametric active learning problem described above is minimax-optimal (up to a logarithmic factor). Recall that the excess risk is the difference between the probability of error of the S 2 estimator and the Bayes error rate. The active learning minimax lower bound for excess risk is given by n −1/(d−1) [Castro and Nowak, 2008], a significant improvement upon the passive learning bound of n −1/d [Scott and Nowak, 2006]. Previous algorithms (nearly) achieving this rate required the boundary fragment assumption Castro and Nowak [2008], and so S 2 is near-optimal for a much larger and more realistic range of problems.
Theorem 2. For any classification problem satisfying conditions A1-A3, there exists a constant C(k, β, ∆ 1 , γ) > 0 such that the excess risk achieved by S 2 with n samples on this problem is no more than C( log n n ) To prove this theorem, we use Theorem 1 to bound the number of samples required by S 2 to be certain (with high probability) of the classification rule everywhere but the cells that are intersected by the boundary ∂B * . We then use the regularity assumptions we make on the distribution of the features and the complexity of the boundary to arrive at a bound on the excess risk of the S 2 algorithm. This allows us to estimate the excess risk as a function of the number of samples obtained. Refer to Appendix C for the details of the proof.

Experiments
We performed some preliminary experiments on the following data sets: (a) Digits: This dataset is from the Cedar Buffalo binary digits database originally Hull [1994]. We preprocessed the digits by reducing the size of each image down to a 16x16 grid with downsampling and Gaussian smoothing Le Cun et al. [1990]. Each image is thus a 256-dimensional vector with elements being gray-scale pixel values in 0-255. We considered two separate binary classification tasks on this data set: 1 vs 2 and 4 vs 9. Intuitively one might expect the former task to be much simpler than the latter. For each task, we randomly chose 200 digits in the positive class and 200 in the negative. We computed the Euclidean distance between these 400 digits based on their feature vectors. We then constructed a symmetrized 10-nearest-neighbor graph, with an edge between images i, j iff i is among j's 10 nearest neighbors or vice versa. Each task is thus represented by a graph with exactly 400 nodes and about 3000 undirected unweighted edges. Nonetheless, due to the intrinsic confusability, the cut size and the boundary (i.e., edges connecting the two classes) varies drastically across the tasks: 1 vs 2 has a boundary of 92, while 4 vs 9 has a boundary of 290. (b) Congressional Voting Records (CVR): This is the congressional voting records data set from the UCI machine learning repository [Bache and Lichman, 2013]. We created a graph out of this by thresholding (at 0.5) the Euclidean distance between the data points. This was then processed to retain the largest connected component which had 380 vertices and a boundary size of 234. (c) Grid: This is a synthetic example of a 15x15 grid of vertices with a positive core in the center. The core was generated from a square by randomly dithering its boundary. See Figure 3.
We compared the performance of four algorithms: (a) S 2 (b) AFS -the active learning algorithm from Afshani et al. [2007]; (c) ZLG -the algorithm from Zhu et al. [2003b]; and (d) BND -the experiment design-like algorithm from Gu and Han [2012].
We show the number of queries needed before all nodes in ∂C have been queried. This number, which we call ∂C-query complexity, is by definition no smaller than |∂C|. Notice that before completely querying ∂C, it is impossible for any algorithm to guarantee zero error without prior assumptions. Thus we posit that ∂C-query complexity is a sensible measure for the setting considered in this paper. In fact ∂C-query complexity can be thought of as the experimental analogue of the theoretical query complexity of Section 4. These results are shown in Table 1. The bold figures show the best performance in each experiment. As can be seen, S 2 clearly outperforms AFS and BOUND as suggested by our theory. It is quite surprising to see how well ZLG performs given that it was not designed with this objective in mind. We believe that trying to understanding this will be a fruitful avenue for future work. Acknowledgements RN is supported in part by the National Science Foundation grant CCF1218189 and the National Institutes of Health grant 1 U54 AI117924-01; XZ is supported in part by National Science Foundation grants IIS 0916038, IIS 0953219, IIS 1216758, and the National Institutes of Health grant 1 U54 AI117924-01.
A Proof of Proposition 1 Proposition 1. Suppose A is an algorithm that has access to f through a noiseless oracle (i.e., a 0noisy oracle), and suppose that it has a −query complexity of q, then for each γ ∈ (0, 0.5), there exists an algorithmÃ which, using a γ−noisy oracle achieves a 2 −query complexity given by q × 1 2(0.5−γ) 2 log n .
Proof. Given a γ > 0, one can designÃ as follows.Ã simply runs A as a sub-routine. Suppose A requires the label of a vertex v ∈ V to proceed,Ã intercepts this label request and repeatedly queries the γ−noisy oracle r (as defined above) times for the label of v. It then returns the majority votef (v) as the label of v to A. The probability that such an algorithm fails can be bounded as follows.
where (a) follows from the union bound and fact that A has a −query complexity of q. (b) follows from applying the Chernoff bound [Chernoff, 1952] to the majority voting procedure : Therefore, if we set r as in the statement of the proposition, we get the desired result.
B Proof of Lemma 1 Lemma 1. Consider a graph G = (V, E) and a labeling function f with balancedness β. For all α > 0, a subset L chosen uniformly at random is a witness to the cut-set with probability at least 1 − α, as long as |L| ≥ log(1/(βα)) log(1/(1−β)) . Proof. The smallest component in V is of size at least βn. Let E denote the event that there exists a component V i such that V i ∩ L = ∅ and letβ = 1 − β. Then, using the union bound and ignoring integer effects, we have P <β |L| β , where the last inequality follows from the fact that β < 1.
To conclude, we observe that if we pick |L| as stated in the lemma, then the right-hand side of the above equation drops below α. This concludes the proof.

C Proof of Theorem 2
Recall that we propose to run S 2 on the lattice graph G corresponding to the partition P w of [0, 1] d . And, recall that when S 2 requests a noisy sample of a vertex in G, a random feature is drawn from the cell that correpsonds to this vertex and its label is returned. Assumption A3 therefore implies that S 2 has access to a γ−noisy oracle 7 . In what follows, we will derive bounds on the −query complexity of S 2 in this setting assuming it has access to a noiseless oracle. Then, arguing as in Proposition 1, we can repeat each such query requested by S 2 a total of and take a majority vote in order to get the 2 −query complexity for a γ−noisy oracle. So, in the sequel we will assume that we have access to a noise free oracle.
We assume that w is sufficiently large so that w > max{β −1/d , 2∆ −1 1 }. The first condition is needed since each homogenously labeled component of the problem corresponds to at least βw d vertices of the lattice graph G and the second condition ensures that there are exactly k connected components in G.
First, we observe that by Lemma 1, if S 2 randomly queries at least log(1/β )/ log(1/(1 − β)) vertices, then with probability greater than 1 − it will discover at least one vertex in each of the k connected components. Next, we observe that since there are k connected components of vertices, there are no more than k 2 /4 cut components in the cut-set 8 . As described in the proof of Theorem 1, once it knows a witness to the cut set, the number of queries made by S 2 can be bounded by adding the number of queries it makes to first discover one cut-edge per each of these cut components to the number of queries needed to perform local search in each of the cut components. Reasoning as in the proof of Theorem 1, for each cut component, S 2 requires no more than log w d queries to find one cut edge. To bound the number of queries needed for the local search, we need to bound the size of the boundary |∂C| and κ, the clusteredness parameter (see Definition 1) of the cut set in G. Towards this end, observe that by assumption A1, there are at most c 1 w d−1 cells of the partition P w that intersects with ∂B * . Since each cell has at most d2 d−1 edges, we can conclude that |∂C| ≤ 2c 1 d(2w) d−1 . To bound κ, let us fix a cut component and note that given one cut edge, there must exist at least one other cut on a two dimensional face of the hypercube containing the first cut edge. Furthermore, this cut edge is contained on a path of length 3 between the vertices of the first cut edge. Since the boundaries of the homogenously labeled components in [0, 1] d are continuous (by definition), it is easy to see that there is an ordering of cut-edges in this cut component e 1 , e 2 , . . . such that the distances between them, per Definition 1, satisfy δ(e i , e i+1 ) = 3. Since this holds true for all the cut components, this implies that the cut-set is 3-clustered, i.e, κ = 3. Therefore, the complete boundary can be determined by labeling no more than ( log κ + 1) |∂C| = 6c 1 d(2w) d−1 vertices (since log 3 = 2). As observed earlier, if we repeat each of the above queries 1 2(0.5−γ) 2 log(w d / ) times, we can see that if the number of queries made by S 2 satisfies one can ensure that with probability at least 1 − 2 , S 2 will only possibly make mistakes on the boundary of the Bayes optimal classifier ∂B * . Let E be this event and therefore P[E c ] ≤ 2 . If we let S 2 (X) and B * (X) denote the prediction of a feature X by S 2 and the Bayes optimal classifier respectively, observe that the excess risk ER[S 2 ] of S 2 satisfies where (a) follows from conditioning on E. (b) follows from observing first that conditioned on E, S 2 (X) agrees with B * (X) everywhere except on the cells of P w that intersect the Bayes optimal boundary ∂B * , and that on this set, we can bound P [S 2 (X) = Y |E] − P [B * (X) = Y |E] ≤ 1. The last step follows since by assumption A1, there are at most 2c 1 (2w) d−1 vertices on the boundary, and since, by assumption A2, the probability of a randomly generated feature X belonging to a specific boundary cell is w −d . Therefore, by taking = 1/w we have that the excess risk of S 2 is bounded from above by (2 + c 1 2 d )w −1 and for this choice of , the number of samples n satisfies Finaly, we conclude the proof by observing that if n satisfies (11) and if w is sufficiently large, there exists a constant C which depends only on c 1 , k, β, γ, d such that C log n

D The Tightness of S 2
We will now argue that the upper bounds we derived in the main paper are tight. Towards this end, in what follows, we will assume that a witness (cf. Section 4) to the cut set is known. This allows us to separate the effect of the random sampling phase and the learning phase in such problems.

D.1 Parameter optimality of S 2
In this section, we will show that S 2 is near optimal with respect to the complexity parametrization introduced in Section 4.1. In particular, we will show that given particular values for n, κ, m and |∂C|, there exists a graph such that no algorithm can significantly improve upon S 2 . For what follows, we will set c |∂C|. Let us define P (n, c, m, κ) ∈ N 4 : m ≤ c, c(κ + 2) ≤ n .
We will show that as long the given problem parameters are in P, S 2 is near optimal. While it is trivially true that the number of cut components, m has to be no more than c, the second condition places finer restrictions on the parameter values. These conditions are specific to the construction we present below and can be significantly weakened at the expense of clarity of presentation.
We will now prove the following theorem. r = 4, k= 9  Theorem 3. Given a set of values for n, c, m, κ ∈ P, there exists a graph G on n vertices and a set of labelings F on these vertices such that each f ∈ F satisfies: • f induces no more than c cuts in the graph.
• The number of cut-components is m • Each component is κ-clustered.
Furthermore, log |F| is no smaller than Remark: Notice that log |F| is a lower bound on the query complexity of any algorithm that endeavors to learn c cuts in this graph that are decomposed into m components, each of which is κ−clustered, even if the algorithm knows the values m, c, and κ. This concludes the proof.

D.2 Two Dimensional Grid
In this section, we will show that in the case of the 2-dimensional grid S 2 is near optimal even if we fix the graph before hand. Notice that in this sense, this result is stronger than the one presented in the previous section and is particularly relevant to the theory of nonparametric active learning. Consider the example of a 2-dimensional r × r grid, where the bottom-left vertex is labeled +1 and the top-right vertex is labeled −1 (see Fig. 5). We want to count/lower bound the total number of labelings such that there are exactly 2 connected components and such that the cut-size of the labeling is no more than r. Notice that the logarithm of this number will be a lower bound on the query complexity of any algorithm that endeavors to learn a cut set of size no more than r.
Theorem 4. The number of ways to partition an r × r grid into 2 components using a cut of size at most r such that the bottom-left vertex and top-right vertex are separated is lower bounded by 2 r .
Proof. We will first restrict our attention to cuts of size exactly r. Consider the grid shown in Figure 6. We will begin by making a few simple observations. Each of the (r − 1) × (r − 1) boxes that contains a cut, has to contain at least 2 cuts. Furthermore, since these cuts are only allowed to partition the grid into 2 connected components, cuts are located in contiguous boxes. Therefore, there are at most r − 1 boxes that contain cuts. We will think of a cut as a walk on the grid of (r − 1) × (m − 1) boxes (labeled as (i, j), 1 ≤ i, j ≤ r − 1 in Fig 6) and lower bound the total number of such walks. Observe that for a walk to correspond to a valid cut, it must contain one of the boxes labeled S and one of the boxes labeled T . By symmetry, it suffices only consider walks that originate in an S box and end in a T box.
To lower bound the number of valid walks, we are going to restrict ourselves to positive walks -walks that only move either right (R) or down (D). Notice that such walks traverse exactly r − 1 boxes. Towards this end, we first observe that there are 2(r−1) such walks each of which originates in an S-block and terminates at the diametrically opposite T -block. These walks are made up of entirely R moves or entirely of D moves. Therefore, to count the number of remaining walks, we can restrict our attention to walks that contain at least one R move and one D move. Notice that such walks cannot cross over the diagonal. Therefore, by symmetry, it suffices to consider walks that start in an S-box on the left column: {(1, 1), . . . , (1, r − 1)} and end in a T -box in the bottom row: {(1, 1), (2, 1), . . . , (r − 1, 1)}. Suppose, for j ≥ 2, we start a walk at block (1, j), then the walk has to make exactly j − 1 down moves and (m − 2 − j + 1) right moves (since the total number of blocks in the walk is r − 1). Therefore, the total number of such positive walks that originate from (1, j) is m−2 j−1 . Reasoning similarly, we conclude that there are r−3 j=2 r−2 j−1 such positive walks from one of the S-boxes in the left column to one of the T -boxes in the bottom row. Finally, observe that the walk that starts at (1, 1) and ends at (1, m − 1) correspond to two different cuts since the (1, r − 1) box has two valid edges that can be cut. Similarly the walk (1, r − 1) − · · · − (r − 1, r − 1) corresponds to 2 valid cuts. Therefore, the total number of cuts from such walks is given by 2(r − 1) + 2(2 + r−3 j=2 r−2 j−1 ) = 2(r − 1) + 2 r−1 , where the multiplication by 2 inside follows from the symmetry we used.
Observe now that if we allow the cuts to be smaller than r, then the total number of cuts is given by summing over the cut-sizes as follows: r i=2 2(i − 1) + 2 i−1 = r−1 2 + 2 r − 2 ≥ 2 r . This concludes the proof. Therefore, any algorithm will need to submit at least log(2 r ) = O(r) queries before it can discover a cut of size at most r and in fact, from the proof above, this seems like a pretty weak lower bound (since we restricted ourselves only to positive walks). However, observe that since κ = 3 and |∂C| ≤ r here, Theorem 1 (from the manuscript) tells us that S 2 submits no more than O (r) queries for the same. Extending this argument to other families of graphs is an interesting avenue for future work.