gRosSo: mining statistically robust patterns from a sequence of datasets

Pattern mining is a fundamental data mining task with applications in several domains. In this work, we consider the scenario in which we have a sequence of datasets generated by potentially different underlying generative processes, and we study the problem of mining statistically robust patterns, which are patterns whose probabilities of appearing in transactions drawn from such generative processes respect well-defined conditions. Such conditions define the patterns of interest, describing the evolution of their probabilities through the datasets in the sequence, which may, for example, increase, decrease, or stay stable, through the sequence. Due to the stochastic nature of the data, one cannot identify the exact set of the statistically robust patterns by analyzing a sequence of samples, i.e., the datasets, taken from the generative processes, and has to resort to approximations. We then propose gRosSo, an algorithm to find rigorous approximations of the statistically robust patterns that do not contain false positives or false negatives with high probability. We apply our framework to the mining of statistically robust sequential patterns and statistically robust itemsets. Our extensive evaluation on pseudo-artificial and real data shows that gRosSo provides high-quality approximations for the problem of mining statistically robust sequential patterns and statistically robust itemsets.


Introduction
Frequent pattern mining [2] is one of the fundamental tasks in data mining, and requires to identify all patterns appearing in fractions at least θ of all transactions from a transactional dataset. Several variants of the problem have explored different types of patterns (from itemsets [3] to sequential patterns [4], to subgroups [5], to graphlets [6]) relevant to applications ranging from market basket analysis to recommendation systems to spam detection.
In several real applications, a pattern is studied in the context of a sequence of datasets, where the sequence is given, for example, from the collection of the data at different time points. For example, in market basket analysis, it is natural to study the patterns (e.g., itemsets) in datasets obtained from transactions in different weeks or months. In almost all applications, one can assume that each dataset is obtained from a generative process on transactions, which generates transactions according to some probability distribution, as assumed by statistically sound pattern mining [7]. Let us consider, for example, a series of n surveys performed in n different time intervals in a supermarket, where we collect the data of the receipts of the costumers. The goal of such surveys is to infer information on how the behavior of the entire customers population evolves, but, obviously, it is impossible to collect the receipts of the whole population. Thus, our datasets only represent a collection of samples from the whole population.
In such a scenario, patterns of interest are the ones whose probability of appearing in a transaction follows some well-specified trend (e.g., it increases, decreases, or is constant across datasets). In the survey example above, we may be interested in finding sequences of purchases (i.e., sequential patterns) which become more and more common in time to understand how the customers' behavior changes over time. However, the identification of such patterns is extremely challenging, since the underlying probability distributions are unknown and the observed frequencies of the patterns in the data only approximately reflect such probabilities. As a result, considering the same trends at the level of observed frequencies leads to reporting several false positives. This problem is exacerbated by the huge number of potential candidates, which poses a severe multiple hypothesis correction problem [8]. In addition, techniques developed for significant pattern mining [7] or for statistically emerging pattern mining [9] can only be applied to (a sequence of) two datasets.
To address such challenges, in this work we introduce a novel framework to identify statistically robust patterns from a sequence of datasets, i.e., patterns whose probability of appearing in transactions follows a well-specified trend, while providing guarantees on the quality of the reported patterns in terms of false positives or in terms of false negatives.

Our contributions
In this work, we introduce the problem of mining statistically robust patterns from a sequence of datasets. In this regard, our contributions are: -We define the problem of mining statistically robust patterns, and define an approximation of such patterns that does not contain false positives. We also describe three general types of patterns (emerging, descending, and stable) which are of interest in most scenarios. -We introduce an algorithm, gRosSo, to obtain a rigorous approximation, without false positives, of the statistically robust patterns from a sequence of datasets with probability at least 1 − δ, where δ is a confidence parameter set by the user. Our strategy is based on the concept of maximum deviation and can employ any uniform convergence bound (see Sect. 2). We show how such a strategy can be used to approximate the three types of statistically robust patterns we introduced. -We define an approximation of the statistically robust patterns that does not contain false negatives, and explain how gRosSo can be modified to obtain such an approximation with high probability. We also discuss and prove additional guarantees that can be obtained with gRosSo. -We apply the general framework of statistically robust patterns to mine sequential patterns. We also introduce a novel algorithm to compute an upper bound on the capacity of a sequence that can be used to bound the maximum deviation using the statistical learning concept of VC-dimension of sequential patterns, which may be of independent interest. -We apply the general framework of statistically robust patterns to mine itemsets using the VC-dimension of itemsets to bound the maximum deviation. -We perform an extensive experimental evaluation, mining statistically robust sequential patterns and itemsets from pseudo-artificial datasets. Our evaluation proves that relying on frequency alone leads to several spurious discoveries, while gRosSo provides highquality approximations for both data mining tasks. Finally, we analyze real datasets mining statistically robust sequential patterns, proving that gRosSo is able to detect various type of patterns.

Related works
We now discuss the relationship of our work to prior art on significant pattern mining, emerging pattern mining, and robust pattern mining, which are the areas most related to our work. We also focus on works that considered sequential pattern and itemset mining, which are the applications of our framework that we present in this paper, and that use concepts from statistical learning theory, as done in our work. In significant pattern mining the dataset is seen as a sample from an unknown distribution and one is interested in finding patterns significantly deviating from an assumed null distribution (or hypothesis). Many variants and algorithms have been proposed for the problem. We point interested reader to the survey [7] and the recent works [10][11][12]. Few works have been proposed to mine statistically significant sequential patterns [13][14][15]. These methods are orthogonal to our approach, which focuses on finding patterns whose frequencies with respect to (w.r.t.) underlying generative distributions respect well-defined conditions through a sequence of datasets.
The first work that proposed the problem of mining emerging patterns is [16]. To the best of our knowledge, the only work that considers the problem of finding emerging patterns considering a data generative process and provides statistical guarantees is [9]. However, the proposed approach only works with two datasets and only finds patterns with significant differences in the two datasets. Instead, our approach describes more general trends of the probabilities of the patterns and considers more than two datasets, and it is unclear whether the approach of [9] can be modified to work in our scenario. Frequent itemset mining [3] and frequent sequential pattern mining [4] are two fundamental data mining problems, and several algorithms have been proposed for these tasks (e.g., [17][18][19][20]). Servan-Schreiber et al. [21] are the first who apply the statistical learning theory concept of VC-dimension to sequential patterns, and they provide the first computable efficient upper bound on the empirical VC-dimension of sequential patterns, based on the notion of capacity of a sequence. In this work, we propose a tighter upper bound on the capacity of a sequence to compute it and we apply it in a different scenario. More recently, Santoro et al. [22] provide a sampling-based algorithm to compute approximations for the frequent sequential patterns problem, based on an upper bound on the VC-dimension of sequential patterns. They are also the first who consider the problem of mining true frequent sequential patterns, that are frequent sequential patterns w.r.t. an underlying generative process. They propose two approaches to compute approximations of such a problem: one based on the empirical VC-dimension and the other based on the Rademacher complexity. While we use a general framework similar to the one proposed by [22], we consider the problem of mining statistically robust patterns in a sequence of datasets, that is a different task. Riondato and Upfal [23] are the first who apply the VC-dimension to itemsets, providing a samplingbased algorithm to compute approximations for the frequent itemsets problem. Riondato and Vandin [24] are instead the first who consider the extraction of frequent patterns w.r.t. an underlying generative process, based on the concept of empirical VC-dimension of itemsets. While in our application to mine statistically robust itemsets we use some of the results provided in these works, we consider the problem of mining itemsets in a sequence of datasets, that is a different problem.
Few works have been proposed to mine robust patterns, where the robustness is usually defined by constraints between the relation of the observed frequency of a pattern in a dataset and the frequencies of its sub-or super-patterns. For example, Zhu et al. [25] define robust patterns as patterns for which, by removing some of their sub-patterns, the ratio between its original frequency and the frequency of the resulting pattern in a dataset is greater than a user defined parameter. Egho et al. [26] introduce a space of rules patterns model and they define a Bayesian criterion for evaluating the interest of sequential patterns for mining sequential rule patterns for classification purpose. Differently from our work, these contributions focus on a single dataset and do not consider a dataset as a collection of samples from an unknown generative process.
This version of our work differs in many ways from the preliminary one that appeared in the proceedings of IEEE ICDM'20 [1]. The major changes are the following: -We include additional proofs and pseudo-code that had been removed from the previous version due to space constraints. -We define a false negatives free approximation, and we discuss how gRosSo can be extended to obtain such an approximation (Sect. 4.4). -We discuss additional guarantees that can be obtained with gRosSo for both types of approximations (Sect. 4.5). -We include another application of the general framework of statistically robust patterns, namely mining statistically robust itemsets, using the VC-dimension of itemsets to bound the maximum deviation (Sect. 6). -We extend our experimental evaluation to include experiments on mining statistically robust itemsets from pseudo-artificial datasets, and on mining false negatives free approximations for both statistically robust sequential patterns and statistically robust itemsets (Sect. 7).

Organization of the paper
The rest of the paper is structured as follows. Sect. 2 contains the definitions and concepts used throughout this work. Our framework for statistically robust pattern mining is presented in Sect. 3. Section 4 describes our algorithm, gRosSo to mine statistically robust patterns and provides discussions and proofs of the guarantees that can be obtained with gRosSo. The application of our approach for mining statistically robust sequential patterns is described in Sect. 5, while the application for mining statistically robust itemsets is described in Sect. 6. Section 7 reports the results of an extensive suite of experiments performed to evaluate the effectiveness of gRosSo on pseudo-artificial and real datasets. Section 8 concludes the paper with some final remarks.

Preliminaries
We now provide the definitions and the concepts used throughout the paper. We start by introducing the task of pattern mining and defining the problems of mining frequent and true frequent patterns. Then, we formally define the concept of maximum deviation, which is required by our strategy to find an approximation of the statistically robust patterns, and of VC-dimension, showing how it can be used to bound the maximum deviation.

Pattern mining
Let a dataset D = {τ 1 , τ 2 , . . . , τ m } be a finite bag of |D| = m transactions, where each transaction is an element from a domain U. We assume that the elements of U exhibit a poset structure. We define a pattern p as an element of U, potentially with some constraints. (For example, in itemset mining the domain U consists of all subsets of binary features called items.) A pattern p belongs to a transaction τ ∈ D if and only if p is contained in τ , denoted by p τ . The support set Given a dataset D and a minimum frequency threshold θ ∈ (0, 1], frequent pattern (FP) mining is the task of reporting the set F P(D, θ) of all the patterns whose frequencies in D are at least θ , and their frequencies, that is, Given a generic set A of pairs ( p, ·), where the first element of each pair is a pattern, in the following, with an abuse of notation, we use p ∈ A to indicate that ∃( p, ·) ∈ A, e.g.,

True frequent pattern mining
In several applications, the dataset D is a sample of transactions independently drawn from an unknown probability distribution π on U, that is, the dataset D is a finite bag of |D| independent identically distributed (i.i.d.) samples from π, with π : U → [0, 1]. The true support set T ( p) of p is the set of patterns in U to which p belongs, T ( p) = {τ ∈ U : p τ }, and the true frequency t π ( p) of p w.r.t. π is the probability that a transaction sampled from π contains p, that is, In such a scenario, the final goal of the data mining process on D is to gain a better understanding of the process that generated the data, i.e., the distribution π, through the true frequencies of the patterns, which are unknown and only approximately reflected in the dataset D. Thus, given a probability distribution π on U and a minimum frequency threshold θ ∈ (0, 1], true frequent pattern (TFP) mining is the task of reporting the set T F P(π, θ ) of all patterns whose true frequencies w.r.t. π are at least θ , and their true frequencies, that is, Let us note that, given a finite number of random samples from π, the dataset D, it is not possible to find the exact set T F P(π, θ ), and one has to resort to approximations of T F P(π, θ ).

Maximum deviation
Let X be a domain set and let P be a probability distribution on X . Let G be a set of functions from X to [0, 1]. Given a function g ∈ G, the expectation E[g] of g is defined as with x ∈ X , and, given a sample A of |A| elements drawn from P, the empirical average E(g, A) of g on A is defined as The maximum deviation is defined as the largest difference, over all functions g ∈ G, between the expectation of g and its empirical average on a sample A, that is, In the TFP mining task, one is interested in finding good estimates for t π ( p) simultaneously for each pattern p ∈ U. In such a scenario, the true frequency t π ( p) and the frequency f D ( p) of a pattern p on D represent, respectively, the expectation and the empirical average of a function associated with p, since with 1 τ ( p) the indicator function that assumes the value 1 if and only if p τ . Thus, in the TFP scenario the maximum deviation is and one is interested in finding probabilistic upper bounds on such a measure, i.e., finding a μ ∈ (0, 1) such that (s.t.) Pr sup with a confidence parameter δ ∈ (0, 1). Such probabilistic upper bounds on the maximum deviation can be computed with tools from statistical learning theory, e.g., VC-dimension [27] and Rademacher complexity [28]. More common techniques (e.g., Hoeffding inequality and union bounds) instead do not provide useful results since they require to know the number of all possible patterns that can be generated from the process, which can be infinite or impractical to compute.

VC-dimension
The Vapnik-Chervonenkis (VC) dimension [27,29] of a space of points is a measure of the complexity or expressiveness of a family of indicator functions, or, equivalently of a family of subsets, defined on that space. A finite bound on the VC-dimension of a structure implies a bound of the number of random samples required to approximately learn that structure.
We define a range space as a pair (X , R), where X is a finite or infinite set and R, the range set, is a finite or infinite family of subsets of X . The members of X are called points while the members of R are called ranges. Given A ⊆ X , we define the projection of R in A as P R (A) = {r ∩ A : r ∈ R}. We define 2 A as the power set of A, that is the set of all the possible subsets of A, including the empty set ∅ and A itself. If P R (A) = 2 A , then A is said to be shattered by R. The VC-dimension of a range space is the cardinality of the largest set shattered by the ranges. The main application of VC-dimension in statistics and learning theory is to derive the sample size needed to approximate "learn" the ranges, as defined below.

Definition 2
Let RS = (X , R) be a range space and let γ be a probability distribution on X . Given μ ∈ (0, 1), a bag B of elements sampled from X according to γ is a μ-bag of (X , γ ) if for all r ∈ R, A μ-bag of (X , γ ) can be constructed sampling points from X according to the distribution γ , as follows.
Theorem 1 [30] Let R S = (X , R) be a range space and let γ be a probability distribution on X . Let B a bag of |B| elements sampled from X according to γ and let d be the empirical VC-dimension E V C(RS, B) of R S on B. Then, given δ ∈ (0, 1) and the bag B is a μ-bag of (X , γ ) with probability at least 1 − δ.

Range space of patterns
We now define the range space of patterns and prove how the VC-dimension can be used to bound the maximum deviation in the TFP scenario.

Definition 3
Let U be a domain and let π be a probability distribution on U. We define RS = (X , R) to be a range space associated with U w.r.t. π such that: : p ∈ U} is a family of sets of transactions such that for each pattern p the set T ( p) = {τ ∈ U : p τ } is the true support set of p.
The following theorem is a generalization of a result for sequential patterns appearing in [22]. Here, we provide it for a general pattern mining task.
Theorem 2 Let R S be the range space associated with U w.r.t. π, let D be a finite bag of i.i.d. sample from π, and let v be the empirical VC-dimension E V C(RS, D) of R S on D. Then, given δ ∈ (0, 1) and Proof From Theorem 1, we know that D is a μ-bag of (U, π) with probability at least 1 − δ. Then, from Definition 2, for all r ∈ R. Given a pattern p ∈ U and its real support set T ( p), which is the range r p , from the definition of range space of patterns (Definition 3) we have and Thus, sup p∈U |t π ( p) − f D ( p)| ≤ μ with probability at least 1 − δ.
In Sects. 5 and 6, we discuss, respectively, an efficient computable upper bound of the empirical VC-dimension of sequential patterns and of itemsets, to bound the maximum deviation of the true frequencies for the two data mining tasks.

Statistically robust pattern mining
In this work, we introduce the task of mining statistically robust patterns from a sequence of datasets. Let us consider the scenario in which we have a sequence D n 1 = {D 1 , D 2 , . . . , D n } of n datasets, where each dataset D i is a bag of |D i | i.i.d. samples taken from a probability distribution π i on U, with i ∈ {1, . . . , n}. Let Π n 1 = {π 1 , π 2 , . . . , π n } denote the sequence of the n probability distributions and T p = {t π 1 ( p), t π 2 ( p), . . . , t π n ( p)} the sequence of the true frequencies of the pattern p w.r.t. Π n 1 . In such a scenario, we are interested in finding patterns whose true frequencies w.r.t. Π n 1 respect a well-defined condition cond(T p ) that describes the evolution of their true frequencies through the sequence. For example, one may be interested in finding patterns whose true frequencies are almost the same in all the probability distributions, or patterns whose true frequencies always increase/decrease, and so on. So, given n probabilities distribution Π n 1 = {π 1 , π 2 , . . . , π n }, a condition cond(T p ) on the true frequencies T p that defines the patterns we are interested in, with cond(T p ) = 1 when the condition is satisfied and cond(T p ) = 0 otherwise, statistically robust pattern (SRP) mining is the task of reporting the set S R P(Π n 1 ) of all patterns whose true frequencies w.r.t Π n 1 respect cond(T p ), that is, Similarly to TFP mining, from a sequence of samples (the datasets D n 1 ) it is not possible to find the exact set S R P(Π n 1 ). Thus, one has to resort to approximations. Denoting by The approximation A P does not contain false positives, that is, patterns p / ∈ S R P(Π n 1 ). In Sect. 4.4, we define an approximation that does not contain false negatives. Now, we define three general types of patterns that can be described by the SRPs framework, and that we consider in the rest of this work.
Emerging Patterns (EP): these are patterns whose true frequencies always increase over the sequence, i.e., patterns p for which t π i+1 ( p) > t π i ( p) + ε, for all i ∈ {1, . . . , n − 1}, for some given emerging threshold ε ∈ [0, 1). Formally, given an emerging threshold ε ∈ [0, 1), we define the emerging condition cond E (T p ) as Descending Patterns (DP): these are patterns p whose true frequencies always decrease over the sequence, i.e., patterns p for which t π i ( p) > t π i+1 ( p) + ε for all i ∈ {1, . . . , n − 1}, for some given emerging threshold ε ∈ [0, 1). Formally, given an emerging threshold ε ∈ [0, 1), we define the descending condition cond D (T p ) as Stable Patterns (SP): these are patterns whose true frequencies in the n probability distributions are above a minimum frequency threshold θ and do not change too much. In particular, we consider patterns p for which . . , n}, for some given stability threshold α ∈ (0, 1) and a minimum frequency threshold θ ∈ (0, 1). Formally, given a stability threshold α ∈ (0, 1) and minimum frequency threshold θ ∈ (0, 1), we define the stability condition cond S (T p ) as Let us note that many more types of patterns can be described by our proposed framework. For example, one may be interested in patterns whose true frequencies in the different probability distributions have a ratio larger than a user-defined constant, or may be interested in patterns whose true frequencies are stable in some distributions and then increase/decrease in others, or that first increase and then decrease, and so on. In addition, for the EP and DP tasks, we provided general conditions to describe such patterns, while one may also consider constraints using a minimum frequency threshold θ .

GROSSO: approximating the statistically robust patterns
In this section, we describe gRosSo, mininG statistically RObuSt patterns from a Sequence Of datasets, our strategy to provide a rigorous approximation of the SRPs. In particular, gRosSo aims to find an approximation that does not contain false positives (i.e., a FPF approximation, see Sect. 3) with high probability. In Sects. 4.1-4.3 we show how to apply such a strategy to mine approximations of the three types of SRPs we defined in the previous section. gRosSo can also be modified to find approximations with guarantees on the false negatives: in Sect. 4.4, we show how to use gRosSo to find such approximations for the EP task. Finally, in Sect. 4.5 we describe additional guarantees that can be obtained with gRosSo for both types of approximations.
Algorithm 1: gRosSo: find a FPF approximation A P of S R P(Π n 1 ).
Algorithm 1 shows the pseudo-code of gRosSo. For a fixed cond(T p ) that defines the SRPs we are interested in, and given the sequence D n 1 of n datasets and a confidence parameter δ ∈ (0, 1) as input, we start by computing an upper bound μ i on the maximum deviation w.
. . , μ n } the sequence of the n upper bounds on the maximum deviations. (Such upper bounds can be computed, for example, using Theorem 2 and the VC-dimension.) Since cond(T p ) considers the true frequencies T p , which are unknown, we need to define a new condition cond P (F p , μ n 1 ) on the frequencies F p and on the upper bounds μ n 1 . Such new FPF condition takes into account the uncertainty of the data in our samples, i.e., the datasets, in order to avoid false positives, and, for a pattern p, it must be cond( Figure 1 shows such conditions for the EP and SP scenarios as examples. Let us note that cond P (F p , μ n 1 ) can be also evaluated only considering a subsequence of the frequencies F p , and if cond P (F p , μ n 1 ) = 0 for some subsequence, then there are no guarantees that cond(T p ) = 1. Then, we aim to find a starting set of possible candidates. For , which takes into account the uncertainty of the data and avoids false positives, for the EP and SP tasks, with n = 3 datasets each dataset D i , we compute the minimum frequency thresholdθ i which the patterns must have in such a dataset to verify cond P (F p , μ n 1 ) (line 3). We then mine the dataset D k , where k = arg max i∈{1,...,n}θi , with the corresponding minimum frequency thresholdθ k , obtaining the set B = F P(D k ,θ k ) of the starting candidates (line 4). The idea is to mine the dataset with the highest minimum frequency threshold in order to obtain a set of possible candidates that is as small as possible. Let us note that any efficient algorithm for mining frequent patterns can be used to obtain F P(D k ,θ k ). For each pattern p ∈ B, we then create an empty array F p of length n, initialize its k-th element with f D k ( p), and put the pair ( p, F p ) in the set A P containing all possible candidates (lines 6-9). Finally, we explore the remaining datasets (lines [10][11][12][13][14]. For each D i ∈ D n 1 \ D k and for each pattern p ∈ A P , we compute its fre- 12), and we check whether cond P (F p , μ n 1 ) = 1, considering the subsequence of the frequencies F p that has already been computed. If cond P (F p , μ n 1 ) = 0, there are no guarantees that cond(T p ) = 1, and we remove such a pattern from the set of the possible candidates (lines [13][14]. Then, outputs are the patterns that have not been removed from the set of the possible candidates (line 15).

Theorem 3 The set A P returned by gRosSo is a FPF approximation of S R P(Π n
In such a scenario, only the patterns p ∈ S R P(Π n 1 ) can appear in A P , and thus A P is a FPF approximation of S R P(Π n 1 ). Now, let us define the event E i as the event in which sup p∈U From the choice of the confidence parameter used to compute the upper bounds on the maximum deviation, we know that Pr(E i ) < δ/n. So, we have Pr(E i ) < δ. Thus, the set A P returned by gRosSo is a FPF approximation of S R P(Π n 1 ) with probability ≥ 1 − δ.

FPF approximation of the EP
Now, we apply the strategy defined above to find a FPF approximation of the EP. Starting For a given i ∈ {1, . . . , n − 1}, such a condition represents the scenario in which t π i+1 ( p) and  Fig. 1.) Then, starting from such a condition, we compute the minimum frequency threshold for each dataset. Since iterating such a reasoning for all the n datasets and considering f D 1 ( p) ≥ 0, we obtain the minimum frequency thresholdθ E n for the dataset D n ,θ the highest over all the n datasets. Thus, the set F P(D n ,θ E n ) provides the starting candidates. Finally, starting from D n−1 and ending with D 1 , we analyze the remaining datasets and check whether the candidates verify cond E P (F p , μ n 1 ).
If one is interested in patterns with a true frequency above a value θ ∈ (0, 1), i.e., t π i ( p) ≥ θ , ∀ i ∈ {1, . . . , n}, the following strategy can be used to reduce the set of starting candidates.
Since we require that f D 1 ( p) ≥ θ + μ 1 to discard possible false positives, a factor θ + μ 1 must be added toθ E n . Instead, if one is interested in patterns p with t π n ( p) ≥ θ , the minimum frequency thresholdθ E n for dataset D n is

FPF approximation of the DP
Using the same approach proposed to approximate the EP, it is possible to approximate the DP. Starting from cond D (T p ) (Equation 2), we define cond D P (F p , μ n 1 ) as Iterating such a condition for all the n datasets, we obtain the minimum frequency thresholdθ D 1 =θ E n for the dataset D 1 , that is the highest over all the n datasets. Thus, the set F P(D 1 ,θ D 1 ) provides the starting candidates. Finally, starting from D 2 and ending with D n , we analyze the remaining datasets and check whether the candidates verify cond D P (F p , μ n 1 ). In the case of a minimum frequency threshold θ ∈ (0, 1), reasoning analogous to the EP can be applied.
The proof is analogous to the proof of Theorem 4.

FPF approximation of the SP
Finally, we apply the strategy defined above to find an approximation of the SP. Starting from Given i = j ∈ {1, . . . , n}, the first two conditions represent the scenario in which t π i ( p) and , that are the values at which their distance is maximum over all possible values that they can assume. Only if such conditions are true, we can prove that |t π i ( p) − t π j ( p)| ≤ α. The third condition, instead, represents the scenario in which t π i ( p) assumes the value f D i ( p) − μ i , that is the minimum value that it can assume. Only if such a condition is true, we can prove that Fig. 1.) The only condition that affects the minimum frequency thresholds . . , n}, and the set F P(D k ,θ S k ), with k = arg max i∈{1,...,n}θ S i , provides the starting candidates. Finally, we analyze the remaining datasets D i ∈ D n 1 \ D k and check whether the candidates verify cond S P (F p , μ n 1 ).
. . , n}. Thus, we have that for all patterns p ∈ U, it results Let p be a pattern s.t. cond S (T p ) = 0. From Equation 3, there is at least a distribution π i , with i ∈ {1, . . . , n} s.t. t π i ( p ) < θ and/or there is at least a couple of distributions π k , π j , with k = j ∈ {1, . . . , n}, s.t. |t π j ( p ) − t π k ( p )| > α. First, let us consider the case in which there is a distribution π i , with i ∈ {1, . . . , n}, s.t. t π i ( p ) < θ. Since we know that , the condition f D i ( p ) − μ i ≥ θ cannot be verified, and thus cond S P (F p , μ n 1 ) = 0. Now, let us consider the case in which there is a couple of distributions π k , π j , with k and thus cond S P (F p , μ n 1 ) = 0.

Guarantees on false negatives
In this section, we explain how gRosSo can be modified to obtain an approximation without false negatives with high probability. Analogously to what done in Sect. 3, we first define a false negatives free (FNF) approximation A N of S R P(Π n 1 ) as The approximation A N does not contain false negatives, that is, it contains all patterns p ∈ S R P(Π n 1 ). Our algorithm gRosSo can be used to obtain FNF approximations. The procedure is the same described above (see Algorithm 1) but we need to define a new condition cond N (F p , μ n 1 ), a FNF condition that takes into account the uncertainty in the data in order to avoid false negatives, and for a pattern p it must be cond( Figure 2 shows such a condition for the EP scenario as an example. Then, we compute the minimum frequency thresholdθ i for each dataset D i , with i ∈ {1, . . . , n}, considering cond N (F p , μ n i ), and we mine the set of the starting candidates from the dataset with the highest minimum frequency threshold.

Theorem 7
The set A N returned by gRosSo using cond N (F p , μ n 1 ) is a FNF approximation of S R P(Π n 1 ) with probability ≥ 1 − δ.
Proof From the definition of cond N (F p , μ n 1 ), we know that cond( In such a scenario, all the patterns p ∈ S R P(Π n 1 ) appear in A N , and thus A N is a FNF approximation of S R P(Π n 1 ). The remaining of the proof is analogous of the proof of Theorem 3.

FNF approximation of the EP
Now, we apply the strategy defined above to find a FNF approximation of the EP. With a similar reasoning, it is possible to mine a FNF approximation of the descending and stable patterns. Starting from cond E (T p ) (Equation 1), we define cond E N (F p , μ n 1 ) as For a given i ∈ {1, . . . , n − 1}, such a condition represents the scenario in which t π i+1 ( p) and respectively, that are the values at which their distance is maximum over all possible values that they can assume. Only if such a condition is false, we can prove that t π i+1 ( p) ≤ t π i ( p) + ε. (See Fig. 2.) Then, starting from such a condition, we compute the minimum frequency threshold for each dataset. Since it must be f iterating such a reasoning for all the n datasets and considering f D 1 ( p) ≥ 0, we obtain the minimum frequency threshold for each dataset D i , i ∈ {2, . . . , n}, andθ E 1 = 0. Thus, the set F P(D k ,θ E k ), with k = arg max i∈{1,...,n}θ E i , provides the starting candidates. Then, we analyze the remaining datasets D i ∈ D n 1 \ D k and check whether the candidates verify cond E N (F p , μ n 1 ). Let us note that, depending on the values of ε and μ n 1 , the highest minimum frequency thresholdθ E k can be equal or very close to 0, resulting in a huge amount of starting candidates, sometimes infeasible to mine. Thus, to obtain FNF approximations, a reasonable solution is to only consider patterns with a minimum true frequency. If one is interested in patterns with a true frequency above a value θ ∈ (0, 1), i.e., t π i ( p) ≥ θ , ∀ i ∈ {1, . . . , n}, the following strategy can be used to reduce the set of starting candidates. Since we require that f D i ( p) ≥ θ − μ i for all i ∈ {1, . . . , n} to discard possible false negatives, we obtain the minimum frequency thresholdθ for each dataset D i , i ∈ {1, . . . , n}. Instead, if one is interested in patterns p with t π n ( p) ≥ θ , the highest minimum frequency threshold is the maximum between θ − μ n , for dataset D n , and the minimum frequency threshold described above without frequency constraints.

Additional guarantees of GROSSO
In this section, we provide additional guarantees of gRosSo for both types of approximations. In particular, it is possible to derive guarantees on the false negatives that can appear in a FPF approximation returned by gRosSo, and, vice versa, guarantees on the false positives that can appear in a FNF approximation. Such guarantees differ considering different types of patterns (i.e., emerging, descending, and stable), and thus, they must be separately derived for each type of pattern. Here, we prove additional guarantees for the emerging patterns but, with a similar reasoning, it is possible to obtain analogous guarantees for the descending and stable patterns.

Application: mining statistically robust sequential patterns
In this section, we introduce the task of sequential pattern mining, as a concrete realization of the general framework of pattern mining we introduced in Sect. 2.1. Then, we introduce a novel algorithm to compute an upper bound on the capacity of a sequence and we use such an algorithm to compute an upper bound on the empirical VC-dimension of sequential patterns. Finally, we discuss a VC-dimension-based strategy to bound the maximum deviation of the true frequencies of sequential patterns, which can be used in the SRP mining scenario.

Sequential pattern mining
Let I = {i 1 , i 2 , . . . , i p } be a finite set of items. An itemset X is a non-empty subset of I, i.e., X ⊆ I, X = ∅. A sequential pattern (or sequence) s = S 1 , S 2 , . . . , S k is a finite ordered sequence of itemsets, with S i ⊆ I, S i = ∅ for all i ∈ {1, . . . , k}. We say that such a sequence s is built on I and we denote by S the set of all such sequences. The length |s| of s is the number of itemsets in s. The item-length ||s|| of s is the sum of the sizes of the itemsets in it, i.e., ||s|| = |s| i=1 |S i |, where the size |S i | of an itemset S i is the number of items in it. A sequential pattern y = Y 1 , Y 2 , . . . , Y a is a subsequence of an other sequential pattern w = W 1 , W 2 , . . . , W b , denoted by y w, if and only if there exists a sequence of naturals Let us note that an item can occur only once in an itemset, but it can occur multiple times in different itemsets of the same sequence. The capacity c(s) of a sequence s is the number of distinct subsequences of s, that is, c(s) = |{a : a s}|.

VC-dimension of sequential patterns
Given a dataset D for the sequential pattern mining task, that is a finite bag of transactions sampled from S in according to π, we aim to compute the empirical VC-dimension E V C(RS, D) of the range space (see Definition 3) associated with S w.r.t. π on the dataset D in order to find a probabilistic bound μ ∈ (0, 1) on the maximum deviation sup s∈S |t π (s) − f D (s)|. In particular, given E V C(RS, D) and using Theorem 2, it is possible to compute a μ ∈ (0, 1) The exact computation of the empirical VC-dimension E V C(RS, D) of sequential patterns on the dataset D, required by Theorem 2, is computationally expensive. The s-index introduced by Servan-Schreiber et al. [21] provides an efficiently computable upper bound on E V C(RS, D). Definition 4 [21] Let D be a sequential dataset. The s-index of D is the maximum integer d such that D contains at least d different sequential transactions with capacity at least 2 d − 1, such that no one of them is a subsequence of another, i.e., the d transactions form an anti-chain.

New upper bound on the capacity
Definition 4 requires to compute the capacity of each transaction τ ∈ D. The exact capacity c(s) of a sequence s can be computed using the algorithm described in [31], but it is computationally expensive and may be prohibitive for large datasets. Thus, we are interested in efficiently computable upper bounds on c(s). A first naïve bound, that we denote bỹ c n (s) ≥ c(s), is given by 2 ||s|| − 1, but it may be a loose upper bound since c(s) = 2 ||s|| − 1 if and only if all the items contained in all the itemsets of the sequence s are different.
The second upper bound has been introduced in [21]. Such upper bound, that we denote byc(s) ≥ c(s), can be computed as follows. When s contains, among others, two itemsets A and B s.t. A ⊆ B, subsequences of the form C with C ⊆ A are considered twice in 2 ||s|| − 1, "generated" once from A and once from B. To avoid over-counting such 2 |A| − 1 subsequences, [21] proposes to consider only the ones "generated" from the longest itemset that can generate them.
In this work, we introduce a novel, tighter upper boundĉ(s) ≥ c(s). Our upper bound is based on the following observation. Let itemsets A and B be, respectively, the i-th and j-th itemset of the sequence s with i < j, that is, A comes before B in s, and let T = A ∩ B = ∅ be their intersection. Let D be a subset of the bag-union of the itemsets in s that come before A, that is D ⊆ S k ∈s:k<i S k , and let E be a subset of the bag-union of the itemsets in s that come after B, that is E ⊆ S ∈s: > j S . The sequences of the form DC E , with C ⊆ T , are also considered twice, for the same reasons explained above. Given a = i−1 k=1 |S k | the sum of the sizes of the itemsets before A in the sequence s and b = |s| = j+1 |S | the sum of the sizes of the ones that come after B, the number of over-counted sequences of this form is 2 a · (2 |T | − 1) · 2 b . Let us note that this new formula also includes the sequences of the form C , since D and E may be the empty set.
An algorithm to compute an upper boundĉ(s) based on the observation above is given in Algorithm 2. Let s = S 1 , S 2 , . . . , S |S| be a sequence and assume to re-label the itemsets in s by increasing size, ties broken arbitrarily, i.e., following the original order. Letŝ = S 1 , S 2 , . . . , S |ŝ| be the sequence in the new order, s.t. |S i | ≤ |S i+1 |, ∀ i ∈ {1, . . . , |ŝ| − 1}. Let N = [n 1 , n 2 , . . . , n |ŝ| ] be a vector s.t. its i-th element n i is the sum of the sizes of the itemsets that in the original ordered sequence s come before the i-th itemset of the new ordered sequenceŝ. The inputs of our algorithm are the new ordered sequenceŝ and the vector N . First,ĉ(ŝ) is set to 2 ||ŝ|| − 1 (line 2). For each itemset S i ∈ŝ, we check whether there exists an itemset S j , with j > i, s.t. the set T i j = S i ∩ S j is non-empty (line 6). For such S j , we compute the number of over-counted subsequences with the formula above (line 7). In Algorithm 2 (line 7), the min and max functions are used to check which itemset comes first in the original ordered sequence. After checking the entire sequenceŝ for a single itemset S i , we remove the maximum number of over-counted subsequences found for such S i (line 9). Then, we update the vector N , subtracting the size of S i from each n m , if the itemset m comes after the itemset i in the original ordered sequence s (lines 11-13).

Bound on the maximum deviation
Using Algorithm 2 one can compute upper bounds on the capacities of the transactions of D, which can be used to obtain an upper bound on the s-index. Such bound can be used in Theorem 2 as upper bound of the empirical VC-dimension of sequential patterns, in order to compute a bound on the maximum deviation of the true frequencies of sequential patterns. With such a bound on the maximum deviation, we can use gRosSo to find FPF and FNF approximations of the statistically robust sequential patterns.

Application: mining statistically robust itemsets
In this section, we introduce the task of itemset mining, as another concrete realization of the general framework of pattern mining we introduced in Sect. 2.1. Then, we apply the VCdimension to itemsets and we discuss a VC-dimension-based strategy to bound the maximum deviation of the true frequencies of itemsets, which can be used in the SRP mining scenario.

Itemset mining
Let I = {i 1 , i 2 , . . . , i p } be a finite set of items. Let us remember that an itemset X is a non-empty subset of I, i.e., X ⊆ I, X = ∅. We denote by I the set of all possible itemsets composed by items from I. The length |X | of X is the number of items in X and an itemset X is contained in another itemset Y if and only if X ⊆ Y .

VC-dimension of itemsets and bound on the maximum deviation
As described in Sect. 5.2 for the sequential patterns, given a dataset D for the itemset mining task, that is a finite bag of transactions sampled from I in according to π, we aim to compute the empirical VC-dimension E V C(RS, D) of the range space (see Definition 3) associated with I w.r.t. π on the dataset D in order to find a probabilistic bound μ ∈ (0, 1) on the maximum deviation sup X ∈I |t π (X ) − f D (X )|. In particular, given E V C(RS, D) and using Theorem 2, it is possible to compute a μ ∈ (0, 1) s.t. sup X ∈I |t π (X ) − f D (X )| ≤ μ. The d-index introduced by Riondato and Upfal [23] provides an efficiently computable upper bound on E V C(RS, D).
Definition 5 [23] Let D be a dataset for the itemset mining task. The d-index of D is the maximum integer d such that D contains at least d different transactions of length at least d, such that no one of them is a subset of another, i.e., the d transactions form an anti-chain.
The d-index can be used in Theorem 2 as upper bound of the empirical VC-dimension of itemsets in order to compute a bound on the maximum deviation of the true frequencies of itemsets. With such a bound on the maximum deviation, we can use gRosSo to find FPF and FNF approximations of the statistically robust itemsets.

Experimental evaluation
In this section, we report the results of our experimental evaluation on multiple pseudoartificial datasets to assess the performance of gRosSo for approximating the statistically robust sequential patterns and itemsets. Then, we execute gRosSo on multiple real datasets to approximate the statistically robust sequential patterns and we analyze the sequential patterns mined. To bound the maximum deviations, as required by gRosSo, we use Theorem 2. The VC-dimension of sequential patterns is bounded using the s-index obtained by using our algorithm (Algorithm 2) to compute the upper bound on the capacity of each sequential transaction, while the VC-dimension of itemsets is bounded using the d-index (Definition 5).
The goals of the evaluation are the following: -Assess the performance of our algorithm to compute an upper bound on the capacity c(s) of a sequence s, comparing our upper bound with the naïve bound and with the one proposed by [21] (see Sect. 5.3). -Assess the performance of gRosSo on pseudo-artificial datasets to mine statistically robust sequential patterns and itemsets, checking whether, with probability 1 − δ, the set of patterns returned by gRosSo does not contain false positives or false negatives. -Assess the performance of gRosSo to mine statistically robust sequential patterns on real datasets.
Since this is the first work that considers the problem of mining SRPs, there are not methods to compare with.

Implementation, environment, and real datasets
We implemented gRosSo for mining statistically robust sequential patterns and itemsets, and our algorithm to compute an upper bound on the capacity of a sequence in Java. To mine the frequent sequential patterns and frequent itemsets, we used, respectively, the PrefixSpan [20] and the FP-Growth [18] implementations both provided by the SPMF library [32]. We performed all experiments on the same machine with 512 GB of RAM and 2 Intel(R) Xeon(R) CPU E5-2698 v3 @ 2.3GHz, using Java 1.8.0_201. Our open-source implementation and the code developed for the tests and to generate the datasets are available at https://github. com/VandinLab/gRosSo. In all experiments, we fixed δ = 0.1.
Here, we provide the details on the generation of the real datasets for the sequential pattern mining task. The details on the generation of pseudo-artificial datasets for the sequential pattern and itemset mining tasks are, respectively, in Sects. 7.3.1 and 7.3.2. To obtain sequences of real sequential datasets, we generated multiple datasets starting from the Netflix Prize data, 1 which contains over 100 million ratings from 480 thousand randomly chosen anonymous Netflix customers over 17 thousand movie titles collected between October 1998 and December 2005.
To generate a single dataset, we collected all the movies that have been rated by the users in a given time interval (e.g., in 2004). Each transaction is the temporal ordered sequence of movies rated by a single user, with the movies sorted by ratings' date. Movies rated by such a user in the same day form an itemset and each movie is represented by its year of release. Considering consecutive time intervals, we obtained a sequence of datasets, where each dataset only contains data generated in a single time interval. From the original data we removed movies which year of release is not available and movies that have been rated in a year that is antecedent to their year of release. The latter are due to one of the perturbations introduced in the data to preserve the privacy of the users. 2 We considered the data collected between January 2003 and December 2005. For each year 2004 and 2005, we generated two types of sequences: the first one composed by 4 datasets, e.g., 2004(Q1-Q4) (each dataset contains the data generated in 3 months), and the second one composed by 3 datasets, e.g., 2004(T1-T3) (each dataset contains the data generated in 4 months). Finally, we generated another sequence of datasets, 2003-2005, considering the entire data between 2003 and 2005 (each dataset contains the data generated in one year).
The characteristics of the generated real datasets are reported in Table 1.

Upper bound on the capacity
In this section, we report the results of Algorithm 2, which computes the upper boundĉ(s) on the capacity of a sequence, and compare it with the naïve upper boundc n (s) = 2 ||s|| − 1, and the upper boundc(s) from [21]. (See Sect. 5.3.) Table 1 shows the averages (over all transactions) of the relative differences between our novel upper boundĉ(s) and the previously proposed ones, which, for a dataset D, are computed as In all the datasets, our novel bound is (on average) tighter than the other bounds, with a maximum improvement of 13.81% on the naïve method and 13.37% on the method proposed by [21].

Results with pseudo-artificial datasets
In this section, we report the results of our evaluation on pseudo-artificial datasets. First, we describe the experimental evaluation using pseudo-artificial datasets for the sequential pattern mining task (Sect. 7.3.1), and then for the itemset mining task (Sect. 7.3.2).

Sequential patterns
Here, we report the results of our experimental evaluation using pseudo-artificial datasets for the sequential pattern mining task. We considered the 2005(T1-T3) sequence of datasets as ground truth for the sequential patterns, and we generated random datasets taking random samples from each of the datasets in the sequence. In such a way, we know the true frequencies of the sequential patterns (the probability that a pattern belongs to a transaction sampled from a dataset is exactly the frequency that such a pattern has in that dataset). Then, we executed gRosSo on the pseudo-artificial datasets and, by knowing the true frequencies of the patterns, we assessed its performance in terms of false positives, false negatives, and of correctly reported patterns. Since it is not feasible to obtain all the statistically robust sequential patterns due to the gargantuan number of candidates to consider in such datasets, for the EP and DP scenarios, we only considered patterns with true frequency above a minimum threshold θ in the last and first dataset, respectively, while for the SP with true frequency above θ in all the datasets, as defined in Sect. 3. From each of the three original datasets, 2005T1, 2005T2 and 2005T3, we generated a random dataset with the same size of the corresponding original one, obtaining a sequence of three random datasets. From such a sequence, we mined the set of statistically robust sequential patterns without considering the uncertain of the data, i.e., directly using Equation 1, Equation 2, or Equation 3, using the observed frequencies of the patterns in the random datasets. This allows us to verify whether the set of sequential patterns obtained considering only the frequencies (i.e., without taking the uncertainty into account) results in false positives or in false negatives.
We then ran gRosSo on the sequence of random datasets to mine a FPF or a FNF approximation of the statistically robust sequential patterns, and checked whether the returned approximation contained, respectively, false positives or false negatives. We also reported what fraction of statistically robust sequential patterns is reported by gRosSo. (For both gRosSo and the observed frequency-based approach above, we only considered patterns with frequency greater than θ as explained above, matching our ground truth.) Table 2 reports the average results, over 5 different random sequences, denoted by S n 1 , for mining FPF approximations of the EP and DP with ε ∈ {0, 0.01, 0.05}, Table 3 reports the average results for mining FPF approximations of the SP with α ∈ {0.05, 0.1}, while Table 4 reports the average results for mining FNF approximations of the EP. We repeated the entire procedure with 5 sequences of random datasets, denoted by S n×2 1 , where each random dataset had size twice the original one, and then with five sequences of random datasets, denoted by The results show that, for almost all parameters, the sets of patterns mined in the pseudoartificial datasets only considering the observed frequency of the patterns (i.e., without considering the uncertainty) contain false positives or false negatives with high probability. In addition, such a probability increases with a lower θ , and thus with a large number of patterns. Instead, the patterns returned by gRosSo do not contain false positives or false The table reports: D n 1 : name of the sequences of datasets; ε: emerging threshold; θ : minimum frequency threshold; for both the EP and DP: |GT |: number of SRPs in the ground truth; T.FP f : percentage of times that the SRPs mined using the observed frequencies contain false positives; T.FP g : percentage of times that the SRPs mined using gRosSo contain false positives; |A P |/|GT |: average ratio between reported patterns by gRosSo and patterns in the ground truth over 5 random sequences  Table 2 for the meaning of the other values |GT |/|A N |: average ratio of patterns in the ground truth and reported patterns by gRosSo over 5 random sequences. See Table 2 for the meaning of the other values negatives in all the runs and with all the parameters. The results are even better than the theoretical guarantees, since theory guarantees us a probability at least 1 − δ = 0.9 of obtaining a set without false positives or without false negatives. Let us note that in some cases, the percentage of reported SRPs is small, in particular for the SP. However, such a percentage increases with larger datasets, since techniques from statistical learning theory, such as the VC-dimension, perform better when larger collections of data are available. In the EP scenario, for both types of approximations, FPF and FNF, we also checked whether the approximations returned by gRosSo had the additional guarantees described in Sect. 4.5, and, in all the runs, we found that such additional guarantees were always respected. For the EP and DP with guarantees on the false positives, the results obtained with ε = 0 are very close to the ones reported by Table 2, in many cases even better, while with ε = 0.05 gRosSo reported a lower percentage (between 0.003 and 0.23) of statistically robust sequential patterns, in particular for the DP scenario. For the SP instead, using α = 0.05, we found only few real SRPs in the original data, and gRosSo did not report any of them, while for the EP with guarantees on the false negatives, the results obtained with ε = 0 and ε = 0.05 are very close to the ones reported by Table 4, with a percentage of reported patterns between 0.06 and 0.78.
For the EP and DP scenarios with guarantees on the false positives, we also performed an additional experiment to verify the absence of false positives in the output of gRosSo. We generated a random sequence of datasets taking three random samples from the same original dataset 2005T1. In such a way, the random sequence did not contain any EP and DP, since each pattern had the same true frequency in all the datasets. Then, we executed gRosSo on such a sequence using θ = 0 and ε = 0. Let us note that this choice of parameters is the most challenging scenario, since we searched for all the EP and DP we were able to find. Again, we repeated such an experiment with five different random sequences where each dataset had the same size of the original one, five sequences with double size and five sequences with datasets that had three times the size of the original one. In all the runs, gRosSo correctly did not report any EP and DP.
These results show that, in general, considering the observed frequencies of the patterns is not enough to find sets of SRPs that do not contain false positives or false negatives. Thus, techniques like the one introduced in this work are necessary to find large sets of SRPs without false positives or false negatives. In addition, gRosSo is an effective tool to find rigorous approximations of the statistically robust sequential patterns.

Itemsets
Here, we report the results of our experimental evaluation using pseudo-artificial datasets for the itemset mining task. Starting from the 2005(T1-T3) sequence of datasets for the sequential pattern mining task, we first generated the corresponding sequence of datasets, 2005(T1-T3)IT, for the itemset mining task. For each dataset in the sequence 2005(T1-T3), we generated a new dataset taking the union of the items in each transaction of the dataset, e.g., a sequential transaction τ = {1}, {2}, {6, 7}, {2} becomes a transaction τ = {1, 2, 6, 7}. Then, we considered the 2005(T1-T3)IT sequence as ground truth for the itemsets, and we performed the same experimental evaluation described in Sect. 7.3.1 for the sequential patterns. We denote by Q n 1 , Q n×2 1 , and Q n×3 1 the analogous to S n 1 , S n×2 1 , and S n×3 1 , but for itemsets. Table 5 reports the average results for mining FPF approximations of the EP and DP, Table 6 reports the average results for mining FPF approximations of the SP, while Table 7 reports the average results for mining FNF approximations of the EP. The results show that, for almost all parameters, the sets of patterns mined in the pseudo-artificial datasets only  Table 2 for the meaning of the values  Table 3 for the meaning of the values considering the observed frequency of the patterns contain false positives or false negatives with high probability. Instead, the patterns returned by gRosSo do not contain false positives or false negatives in all the runs, as observed for the sequential patterns. In addition, all the approximations of the EP reported by gRosSo respected the additional guarantees introduced in Sect. 4.5. All these results emphasize that considering the observed frequency is not enough to find large sets of SRPs without false positives or false negatives, and that gRosSo is an effective tool also to find rigorous approximations of the statistically robust itemsets. Comparing these results with the ones obtained for the sequential patterns, it is interesting to notice that in the EP and DP scenarios, almost always the returned statistically robust itemsets are less than the corresponding statistically robust sequential patterns, in particular for the DP, and that also the percentages of reported patterns are lower for the itemsets. Instead, in the SP scenario, more statistically robust itemsets are returned, always with higher percentages of reported patterns.

Results with real datasets
Here, we report the results of gRosSo for mining statistically robust sequential patterns from the Netflix real datasets. First, we report and discuss the results with guarantees on the false positives for all the three types of SRPs. For the EP and DP, we did not use any constraints on the minimum frequency, thus we reported every statistically robust sequential patterns found in the data. Table 8 shows the results for the EP and DP with guarantees on the false positives. In the EP scenario, for the sequences of datasets composed by four datasets  Table 4 for the meaning of the values The table reports: D n 1 : name of the sequences of datasets; ε: emerging threshold; for both the EP and DP: |A P |: number of returned SRPs; Avg||s||: average item-length of the returned SRPs (denoted by Q1-Q4), gRosSo reported only few patterns. In particular, all the emerging sequential patterns returned contain the year of the dataset in which they were found, e.g., in 2004(Q1-Q4) all the EP contain the item 2004, with a frequency close to zero in the first dataset. Since during the year many more movies come out, the number of users that rates such movies increases through the year and so such patterns emerge through the sequence. We found the same result in sequences composed by three datasets (denoted by T1-T3) but in this case gRosSo reported many more patterns, in particular for the 2004 sequence, since now we were considering the emerging condition only in three datasets, and thus patterns with such an emerging behavior are easier to discover.
gRosSo did not report any DP in all the datasets using ε = 0.05. Observing the patterns found on 2005(T1-T3), we noted that the maximum absolute difference max s∈A | f D 1 (s) − f D n (s)| over all the returned patterns between the frequency of a pattern in the first dataset and its frequency in the last dataset was 0.26, while for the EP such a difference was 0.60. Thus, while the frequencies of the EP increase a lot through the year, the frequencies of the DP decrease less, which explains why fewer descending patterns are found by gRosSo. The DP found on 2005(T1-T3) are on average larger than the EP found on the same data, The table reports: α : stability threshold; θ : minimum frequency threshold. See Table 8 for the meaning of the other values The table reports: D n 1 : name of the sequences of datasets; θ : minimum frequency threshold; ε: emerging threshold; for both the FPF and FNF approximations: |A|: number of returned SRPs; Avg||s||: average itemlength of the returned SRPs and the 96% of such patterns contain the item 2004, many of them multiple times. Thus, they probably represent long sequential patterns whose frequencies decrease, since the users watch always less 2004's movies through the year 2005 and so, it is difficult for such long patterns to persist through the time. Table 9 shows the results for the SP with guarantees on the false positives. We performed experiments varying θ ∈ {0.2, 0.4} and α ∈ {0.05, 0.1}. With α = 0.05, gRosSo did not report any SP for all the datasets. Almost always the SP found by gRosSo are quite short combinations of items that represents movies of the 90s or early 2000s, that precede the year of the mined sequence. It is surprising that sequential patterns that contain such "old" items are stable through the time, e.g., {2000, 2001}, {1990} has a maximum absolute difference between all its frequencies of 0.025 in the sequence 2003-2005(Y). Such sequential patterns probably represent some classical movies that people always watch with the same frequency through time.
To conclude, we report the results for the EP with guarantees on the false negatives. As discussed in Sect. 4.4, we decided to consider only patterns p with t π n ( p) ≥ θ to reduce the amount of starting candidates. In order to compare the size of FPF and FNF approximations in the same scenario, we also executed the same experiments for the EP with guarantees on the false positives using a minimum frequency threshold. Table 10 reports the parameters and the results of such experiments. These results show that gRosSo can detect EP when one is interested in finding FPF or FNF approximations, and it is possible to notice that almost always the FNF approximations contain a number of EP that is from 4 to 6 times larger than the corresponding number in the FPF approximations.
Overall, the results show that gRosSo detects various types of SRPs from real datasets, obtaining insights into the evolution of the generative process underlying the data.

Conclusions
In this work, we introduced the problem of mining statistically robust patterns from a sequence of datasets, which naturally arises in several applications. We provided a general framework for such a problem and described gRosSo, an algorithm to identify approximations of the SRPs with probabilistic guarantees on false discoveries or on false negatives, and we applied it to identify statistically robust sequential patterns and statistically robust itemsets. Our extensive experimental evaluation shows that gRosSo significantly improves over the naïve approach which ignores the uncertainty in the data, and that it identifies interesting patterns in real datasets. While in our application we use the VC-dimension to bound the maximum deviation, any uniform convergence bound (e.g., from Rademacher complexity) can be used in our framework. Interesting future directions are the use of improved bounds on the maximum deviation, which may lead to higher statistical power, and to consider a streaming setting for the data. not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.