WorksMathematics
Conformal Novelty Detection via Data-enhanced Localization
Abstract
Novelty detection is an important area of research in both statistics and machine learning. In this paper, we focus on the conditional novelty detection problem, where novelties arise from the relationship between different variables. We first adopt the conformal inference framework and propose a data-enhanced localized conformal p-value, constructed by recalibrating an enhanced conditional distribution estimator. This estimator efficiently captures conditional information by incorporating both calibration and test data into its kernel estimation. We show that our p-values are valid in finite samples and can improve detection efficiency. Based on this p-value, we then develop a novel conditional novelty detection algorithm, along with a data-driven bandwidth selection method that ensures finite-sample false discovery rate control while enhancing detection power. Both simulated and real data experiments demonstrate the advantages of our proposed approach.
Introduction
Novelty detection plays a pivotal role in numerous scientific and industrial domains. The objective of novelty detection is to identify observations that significantly deviate from the expected pattern. In fields such as finance, healthcare, industrial monitoring and scientific discovery, novelties often correspond to fraud, disease outbreaks, fatal machine errors and identification of unexpected patterns, respectively [24, 5] (Li et al. 2014). The ability to accurately detect such novelties not only prevents economic and social losses but also facilitates timely decision-making.
The novelty detection problem can be formulated rigorously from a statistical perspective. In novelty detection problems, we generally have access to a reference distribution or a reference dataset sampled from . For a test sample , the target is to determine whether or not. That is, to test for the hypothesis
While this characterizes the marginal pattern, there is another line of scenarios where we are more interested in the relationship between different variables of the data. That is, we need to test for conditional novelties [26, 11]. Let where , , conditional novelty detection aims to detect novelties regarding the conditional distribution of , which is equivalent to the following hypothesis test:
For instance, in fraud monitoring, a transaction may be statistically common in general, but highly unusual for a specific user group. In a bike-sharing dataset, one would like to identify novelties of the rental bike counts which tend to peak around 8:00 and 18:00. To determine whether an observation is a novelty, it is necessary to examine the distribution of rental bike counts conditional on different time periods during the day.
Related works and motivation
Classical novelty detection methods can be broadly categorized into model-based approaches and machine learning-based approaches. Model-based approaches typically rely on assumptions about the data distribution and use robust statistical estimators to identify points that significantly deviate from the estimated structure [16, 4]. In contrast, machine learning-based approaches treat anomaly detection as a learning problem, especially suitable for high-dimensional or large-scale settings [21, 6, 12]. While those existing approaches to both marginal and conditional novelty detection have shown substantial utility, many of them rely on specific distributional assumptions or heuristic scoring mechanisms that may lack theoretical guarantees.
In recent years, conformal prediction [28, 18, 1] has become more and more popular for its ability to provide a flexible and distribution-free framework of uncertainty quantification for black-box models. Given a reference data set, conformal prediction constructs prediction intervals for new test data points with finite-sample coverage guarantees. In addition to constructing prediction intervals, the conformal prediction framework has also been applied to the marginal novelty detection problem, where the conformal p-value is defined to assess how well a new observation conforms to a reference distribution.
To apply conformal inference to conditional novelty detection problems, Wu et al. (2025) proposed to construct the localized conformal p-value (LCP) for each test sample and then to determine it as a novelty if the corresponding p-value is rejected. The LCP incorporates localization into p-value construction with kernel estimation based on calibration data, enabling it to capture information about the conditional distribution . However, such localization can hamper the efficiency of LCP, since the kernel weighting technique usually reduces the effective sample size (Hall et al. [13]). The LCP may even perform worse than the marginal conformal p-value especially in cases with very limited calibration data. Note that a large amount of test data contains helpful information that is ignored by the LCP when constructing the p-value. It is worth investigating how to integrate these test samples to improve the p-value’s efficiency. Additionally, the performance of LCP is sensitive to the choice of bandwidth in the kernel function, which could be difficult to determine in real applications.
To address these challenges, we propose a more efficient methodology for localized novelty detection, termed as Data-Enhanced Localization (DEL). While LCP relies solely on calibration data to estimate the conditional distribution via kernel estimation, we propose a data-enhanced kernel estimator that incorporates both calibration and test data, thereby improving the efficiency of p-values. However, since the test data may include a proportion of novelties that violate exchangeability assumptions, we introduce a density-ratio estimator to account for potential distributional shifts between the calibration and test datasets. This adjustment ensures robustness in the presence of such shifts. The proposed p-values are seamlessly integrated with the conditional calibration framework (Fithian and Lei [7]), resulting in a novel novelty detection algorithm. This algorithm not only guarantees a finite-sample false discovery rate (FDR) but also demonstrates superior statistical power compared to existing methods. Furthermore, we propose an adaptive bandwidth selection strategy that maximizes power in the context of novelty detection, further enhancing the method’s performance.
Our contributions
In this work, the proposed data-enhanced localization method widens the scope of localization technique and is applicable in the case with limited calibration source.
Our contribution can be summarized as follows:
We propose a data-enhanced localized conformal p-value by constructing kernel conditional distribution estimators with both calibration and test data and then performing a recalibration step. The proposed p-value is shown to be finite-sample valid and be more efficient than LCP.
We derive a novelty detection algorithm with the proposed p-value. By utilizing the conditional calibration technique, we prove that our proposed algorithm ensures finite-sample FDR control. The use of data-enhancement helps to identify more novelties, especially in heteroscedastic scenarios.
We provide a reliable strategy for selecting bandwidths of the kernel estimator in a data-dependent manner. With a slight modification to the testing procedure, the optimal bandwidth can be determined by an optimization step. With this adaptive bandwidth, the proposed algorithm for novelty detection can still control the FDR in finite samples.
Data-enhanced localized conformal p-value
In this section, we first provide a brief review of using conformal p-values for novelty detection in § 2.1. Next, we consider conditional novelties, introduce the data-enhanced localized conformal p-value and establish its finite-sample validity and asymptotic efficiency in § 2.2.
Recap: novelty detection with conformal p-value
Consider the marginal novelty detection setting, where we observe i.i.d. data and a test dataset with index set . Let denote the index set of inliers and denote the index sets of novelties, respectively. Our goal is to identify as many true novelties in as possible while controlling the FDR at some pre-specified level :
where is the set of identified novelties. Bates et al. [2] proposes to use conformal p-values for novelty detection, offering a flexible and robust inference tool without requiring explicit modeling of the data distribution. The data is split into a training set and a calibration set with index sets and . A score function , trained on , assigns a nonconformity score to each point, capturing how anomalous an observation appears under the learned model. Typical choices for include scores from one-class classifiers or distance-based methods. For one new test point , its score is compared to the calibration scores , yielding a conformal p-value:
This p-value is guaranteed to be super-uniform under the null if are exchangeable.
The conformal p-values computed with the same calibration set are also shown to be positive regression dependent on a subset (PRDS). This allows one to directly apply the Benjamini-Hochberg (BH) procedure on p-values and take the rejection set as detected novelties with
to ensure FDR .
Data-enhanced localized conformal p-values
In the conditional setting, we aim to test whether a new observation is a novelty with respect to the conditional distribution . Compared to the marginal setting, the key distinction lies in constructing a score function that captures the conformity of given , such as regression residuals or class-conditional likelihoods. The conformal p-value is then computed using the same rank-based formula as in Equation (1), with calibration scores constructed from the conditional setting. A direct way to build p-value is by reverting to the original localized prediction interval in Guan [9]:
where is a kernel function characterizing closeness between covariate values. Note that captures the effect of localized regions around the test sample as the kernel takes larger value on samples closer to . However, similar to the property of localized prediction interval in Guan [9], is not valid in finite samples.
Wu et al. (2025) proposed the localized conformal p-value as a counterpart of localized prediction intervals in Hore and Barber [10]:
where follows the uniform distribution . The is randomly sampled from the density . By introducing the random samples , this localized conformal p-value ensures finite-sample validity, which mirrors the approach used in the randomly localized prediction interval proposed by Hore and Barber [10].
However, as mentioned before, such localization reduces the effective sample size and makes the resulting p-value less efficient, particularly when the calibration set is small.
To resolve this issue, we propose a data-enhanced localized p-value to improve the efficiency. Recall the original localized p-value in (2). We notice that is exactly the kernel estimator for the conditional cumulative distribution function (CDF) of evaluated at point . Although not a valid p-value itself, is permutation-invariant with respect to . This motivates us to consider the conditional CDF estimators as new scores and recalibrate them to construct p-values. To be specific, we obtain those conditional CDF estimators over :
and then the final recalibrated p-value is given by
By the permutation-invariant property, it is easy to prove the exchangeability of and so the validity of p-value in (3). This provides an approach to construct localized conformal p-value given any permutation-invariant conditional CDF estimator.
As discussed in § 1, those conditional CDF estimators , which rely only on calibration data, may become unreliable, resulting in inefficient p-values. Motivated by the intuition that a more accurate estimator of the conditional CDF should lead to improved testing performance, we propose to enhance the estimator by incorporating the test data. The similar technique has also been considered by Marandon et al. [23] to boost the power of marginal novelty detection. As we will show in this section, its application in the conditional case is non-trivial and requires more careful design of the methodology.
For each , denote and with corresponding index sets and . The enhanced conditional distribution estimator at for can then be defined as follows:
The is an estimator of the conditional density ratio between the conditional distribution of calibration data and test data (Tibshirani et al. [27]) and is introduced to cope with the distribution shift between the calibration and test data since the latter may contain samples not following the null distribution. In practice, it can be estimated by fitting binary classifiers to distinguish and . We also introduce a weight parameter to balance the contribution of the test data in the estimator. If , the estimator is identical to . Generally, we can take a larger when a more accurate can be obtained since the enhanced part in the estimator could be reliable in such case.
Remark 1 When is perfectly estimated, it could serve as an efficient score function for conditional novelty detection. However, this is extremely difficult since it is equivalent to distinguish two conditional distributions that are very similar. Since it leads to deteriorated performance in finite samples, we do not consider this score function.
Remark 2 The kernel function can be selected from any commonly used kernel functions in kernel density estimation. In this paper, we primarily consider Gaussian kernel with standard normal density function , which is the most common in kernel methods. This is also the choice in Guan [9] and Hore and Barber [10].
Given the enhanced estimator, we can define the data-enhanced localized conformal p-value for by a similar recalibration step:
Since we do not break the permutation-invariant property when constructing the enhanced estimator, this p-value is still valid in finite samples.
Theorem 1 Suppose that the density ratio estimator is permutation invariant with respect to . For any such that are exchangeable, the corresponding p-value satisfies
Besides the exchangeable assumption on the data, the theorem only requires a permutation invariant density ratio estimator . This holds easily if we train by fitting a binary classifier to distinguish between and .
We also prove the enhanced estimator converges faster to the true conditional distribution by leveraging the test data for kernel estimation, which serves as a circumstantial evidence of higher efficiency. We need the following regularity assumptions.
Assumption 2 Assume that: (1) The density ratio and the density of are bounded and continuous; (2) The conditional distribution of satisfies
for some constant $L > 0, 0 < \beta \leq 1.
Theorem 3 Suppose Assumption 2 holds. If we take the kernel function with Gaussian kernel , the estimator evaluated at any fixed data point satisfies
From the theorem, we can see that the convergence rate for the nonparametric estimation improves with the sample size replaced by . The second term accounts for the accuracy of and is controlled by the parameter . This also provides theoretical support for the recommendation on how to choose .
Conditional novelty detection algorithm
In this section, we derive novelty detection algorithms by utilizing the data-enhanced p-value. § 3.1 presents a detection algorithm with finite-sample FDR control. § 3.2 introduces our data-driven bandwidth selection method, which boosts the power of the detection procedure.
Novelty detection
When applying data-enhanced p-values to novelty detection problems, a direct application of BH procedure is insufficient, as the PRDS property no longer holds for them. Instead, we employ the conditional calibration technique (Fithian and Lei [7]), which is commonly used in conformalized multiple testing methods. This technique allows to control the FDR even when the p-values do not exhibit the PRDS property.
Here, we consider the functions , , and the parameter as fixed. For ease of notation, we denote the set of p-values computed with calibration data , test data and bandwidth as . For each and , define the set of auxiliary p-values as
Let denote the rejection set obtained by applying the BH procedure to auxiliary p-values:
The final rejection set is then defined by letting
where are independent uniform random variables. The full Data-Enhanced Localization procedure for novelty detection is summarized in Algorithm 1.
By introducing auxiliary p-values and rejection set , the conditional calibration procedure decouples the dependency between the p-value and the rejection number, which allows for a term-wise analysis of the FDR. The following theorem shows that the detected novelty set by Algorithm 2 ensures the FDR control in finite samples, which is an instantiation of the result in Fithian and Lei [7] with conditional sets specifically designed in our procedure.
Theorem 4 Suppose and the density ratio estimator is permutation invariant with respect to . The final rejection set output by Algorithm 1 ensures .
Remark 3 The condition is introduced to ensure exchangeability between calibration and null test samples, as required by Theorem 1. In practice, the DEL procedure remains robust and controls the FDR under the nominal level despite certain shifts between and (see Appendix D.7).
Algorithm 1 Novelty detection with DEL
Input: Calibration data and test data with index sets and ; FDR target level ; Kernel function with bandwidth ; Score function ; Density ratio estimator ; Weight parameter
Compute p-value set ;
for do
Compute auxiliary p-values ;
Compute ;
end for
Compute the final rejection set as in (8);
Output: Detected novelty set .
Data-driven bandwidth selection
In this section, we introduce a data-driven bandwidth selection procedure for the kernel estimator of the conditional distribution. In conformal inference, Liang et al. (2024) has considered selecting the score function to construct shortest prediction intervals. Here we instead focus on the localization parameter in our estimator. While extensive methods exist for bandwidth selection in kernel estimators, including rule-of-thumb approaches (Silverman [25]) and cross-validation, these methods are primarily designed to improve estimation accuracy. As a more target-oriented approach, Guan [9] selects the bandwidth by maximizing efficiency of prediction intervals on the training data. In the novelty detection problem, we instead consider maximizing the testing power, which best fits our goal.
Inspired by Zhang et al. [31], the bandwidth which yields the largest number of discoveries is roughly the optimal one with the largest power with FDR control. Hence, the natural approach is running Algorithm 1 with different bandwidth in the kernel function , recording the corresponding number of rejections and taking the bandwidth that leads to the largest number of rejections. However, directly running Algorithm 1 with the selected bandwidth can lead to inflated FDR due to post-selection effects. To cope with this issue, we need to investigate the structure of the data-enhanced p-value and try to preserve its validity.
Recall that the validity of hinges on the exchangeability of . To preserve this property while using a data-driven bandwidth, it is crucial that the bandwidth remains fixed given the unordered set of . Along this line, we propose a slight modification to the testing procedure when determining the bandwidth for the estimator .
Suppose we have a set of candidate bandwidths . For each , we first treat it as a null sample and consider and as the new calibration and test datasets. Next, for each candidate , we compute p-value set
Applying the BH procedure to these p-values yields the number of rejections
The bandwidth for in (4) is selected as the one that results in the largest number of rejections . Note that in Algorithm 1, permuting the calibration set does not affect the final p-values . Consequently, the number of rejections and optimal bandwidth for remain fixed given the unordered set of in the above procedure.
Once the validity of p-value is preserved, we can compute each using its ”optimal” bandwidth and proceed with the conditional calibration procedure as usual. We further take this bandwidth for computing auxiliary p-values for . The complete procedure is summarized in Algorithm 2.
Algorithm 2 Novelty detection with DEL and data-driven bandwidths
Input: Calibration data and test data with index sets and ; FDR target level ; Kernel function with bandwidth ; Score function ; Density ratio estimator ; Weight parameter ; Candidate bandwidth set
for do
for do
Compute p-value set ;
Obtain the rejection number of the BH procedure ;
Take .
end for
Compute by taking the -th value in ;
Compute auxiliary p-values ;
Compute ;
end for
Compute the final rejection set as in (8) with , and replaced by versions in steps 7-9.
Output: Detected novelty set .
Remark 4 Notably, although the computational complexity is , adopting an adaptive bandwidth does not substantially increase computational complexity. This is because the auxiliary p-values and kernel function can be reused. Generally, the whole procedure runs up to 30s on a single core with on the order of hundreds. The selection procedure also has a clear structure for parallelization. When is very large, using parallelization can still control the runtime within several minutes.
As previously illustrated, our procedure with data-driven bandwidths continues to ensure finite-sample FDR control.
Theorem 5. Suppose that the density ratio estimator is permutation invariant with respect to . For any such that are exchangeable, the data-enhanced -value with data-driven bandwidths is valid in that
Furthermore, the rejection set output by Algorithm 2 ensures .
Experiments and evaluation
In this section, we demonstrate the validity and efficiency of our proposed DEL novelty detection procedure through simulated and real-data experiments, as detailed in § 4.1 and § 4.2. Additional experiments are deferred to Appendix D. All experimental results are based on 200 replications.
Simulated experiments
We first validate the performance of our DEL novelty detection procedure on simulated datasets. Here we consider a heterogeneous linear regression model, which is similar to the labeled scenario in Wu et al. (2025).
Data generation: The data vector is with . The model is , with , and independently. The coefficient vector is .
The test data contains 20% novelties following the model , where . We take the nominal level , the weight parameter and training sample size . The calibration and test sample sizes are taken as and when not varying. Other details of the simulation setting can be found in Appendix § 7.
Comparison with baselines
First, we compare the performance of our method with existing novelty detection methods. We consider the following three methods:
CP: the novelty detection method with marginal -values in Bates et al. [2].
LCP: the novelty detection method with localized -values in Wu et al. (2025).
DEL: our proposed novelty detection method in Algorithm 2.
Results. Results for comparing DEL to benchmarks with varying are summarized in Figure 1-Figure 2. As theoretically guaranteed, all three methods control the FDR below the nominal level. From the power perspective, DEL consistently exhibits higher power compared to the other two methods. When comparing two score functions, DEL maintains high power while the other methods show reduced performance with the residual score. This demonstrates that DEL more effectively captures information from the conditional distribution, performing well even with a homogeneous score function.
Figure 1. FDR and power of different methods under test sample sizes .
Figure 2. FDR and power of different methods under different calibration sample sizes .
Ablation studies
Here we show the contribution of each part of our methodology by comparing the performance of Algorithm 1, 2 and the method without utilizing the test data:
UEL (UnEnhanced Localization): replacing the p-values in Algorithm 1 with the p-value in (3) without enhancement.
DEL-fix: Algorithm 1 with a fixed bandwidth.
DEL: Algorithm 2 with adaptive bandwidths.
Results. Results for ablation studies are summarized in Figure 3. While all three versions control the FDR below the nominal level, their power exhibits a stepwise increasing pattern. By integrating information from the test data, DEL-fix achieves higher power than the simplified recalibration version with quantile score. Its power further increases with larger test sample sizes, which validates our theoretical conclusion on efficiency. The DEL consistently demonstrates the highest power across both score functions and all sample sizes. This corresponds to our discussion that DEL is more robust with a data-driven bandwidth compared with a fixed one.
Figure 3. FDR and power of different algorithms under test sample sizes .
To further highlight the effect of using adaptive bandwidth, we provide how the selected distributes when the test sample size and the conditional variance of varies. We fix when varies and when varies.
From Figure 4, we observe clear trends in how the optimal bandwidth varies with and . As the variance decreases or the sample size increases, the optimal bandwidth becomes smaller; conversely, larger or smaller lead to a larger optimal bandwidth. These empirical patterns are consistent with the theoretical expression for the optimal bandwidth in kernel estimation.
Figure 4. Distribution of optimal bandwidth for each test sample with varying and . The bandwidth candidate set is .
Real world datasets
U.S. house price
Dataset. We further evaluate our method on the publicly available House Prices: Advanced Regression Techniques dataset from Kaggle [17]. The main features include SalePrice, GrLivArea (above-ground living area), TotalBsmtSF (basement area), OverallQual (building quality), and Neighborhood (encoded as high-price or not). We treat SalePrice as the response variable , and the remaining features as , . The goal is to detect novelties regarding the conditional distribution of given .
Implementation details. Similar to the novelty detection setting in Song et al. [26], we calculate scores by training a prediction model on the full dataset and take outliers as the 10% of samples with the largest nonconformity scores from both the high-price and low-price groups. We take Neighborhood as the variable used for kernel weighting. The nominal FDR level is set as 0.2.
Results. The FDR and power results for the U.S. house price dataset are reported in Table 1. All three methods successfully control the FDR below the nominal level, while DEL detects the largest number of novelties among them. These findings demonstrate that DEL is applicable in complex real data.
Table 1 FDR and power for the House Sales dataset. Bold numbers represent the best results. The brackets contain the standard errors.
| Score | Value | DEL | LCP | CP |
| Quan | FDR | 0.140(.006) | 0.153(.009) | 0.133(.007) |
| Power | 0.642(.010) | 0.520(.016) | 0.529(.015) | |
| Res | FDR | 0.152(0.005) | 0.168(0.006) | 0.150(0.006) |
| Power | 0.792(0.006) | 0.615(0.009) | 0.565(0.009) |
Table 1.
Bike sharing
Dataset. We use Bike Sharing dataset ([8]) to show the performance of our method on the temporal scenario, which has 17,389 individuals with 13 features. Here we consider the hour in a day as the time feature . The variable of interest is the number of total rental bikes. The goal is to detect novelties regarding the conditional distribution of given the time feature.
Implementation details. For this dataset, we construct 10% synthetic novelties regarding the conditional distribution as
where is the overall mean value of in the whole dataset. We take as the variable used for kernel weighting. The bandwidths are chosen as for the LCP method and for the DEL method.
Results. The empirical FDR and power for Bike Sharing dataset are reported in Table 2. Notably, the dataset exhibits some temporal dependency, as indicated by a slightly inflated FDR for the LCP method. In contrast, DEL maintains FDR control below the nominal level even under weak dependency and achieves the highest power across both score functions.
Table 2 FDR and power for the Bike Sharing dataset. Bold numbers represent the best results. The brackets contain the standard errors.
| Score | Value | DEL | LCP | CP |
| Res | FDR | 0.158(.006) | 0.238(.005) | 0.145(.007) |
| Power | 0.573(.021) | 0.393(.012) | 0.258(.008) | |
| Quan | FDR | 0.165(.009) | 0.209(.005) | 0.149(.007) |
| Power | 0.502(.020) | 0.388(.012) | 0.383(.018) |
Table 2.
Concluding remark
We conclude the paper with two remarks. Firstly, while both LCP and DEL-fix rely on kernel-based conditional distribution estimators to construct p-values, kernel methods do have limitations including boundary effects and inefficiency in high-dimensional settings. Exploring modern machine learning-based approaches for conditional distribution estimation could address these challenges and further enhance performance.
Secondly, the proposed novelty detection procedure with adaptive bandwidth can become computationally burdensome when the candidate set is large. To accommodate a broader range of tuning parameters, it is essential to develop more computationally efficient algorithms that do not rely on the conditional calibration step while still ensuring finite-sample FDR control. We leave these two issues as directions for future research.
Related works
Novelty detection Our work is also related to novelty detection problems. Classical novelty detection methods include model-based approaches [16, 4] and machine learning-based algorithms [21, 6, 12]. Most existing works that consider conditional novelties fall into these two categories [26, 11]. Recent studies have explored the use of conformal inference for novelty detection [2, 23] (Liang et al. 2024). While ensuring finite-sample FDR control, these works primarily focus on the marginal case.
Localized conformal inference. This work is closely related to Guan [9] and Hore and Barber [10], both of which emphasize the effect of localized regions to construct conformal prediction intervals that are valid conditional on the covariate. Guan [9] proposed using a kernel-weighted empirical distribution for calibration but required an adjusted quantile level that is difficult to compute. Hore and Barber [10] alleviates this by incorporating a random sampling step. In contrast, our work focuses on testing problems and emphasizes the construction of p-values rather than prediction intervals.
Conformalized multiple testing. Conformalized multiple testing has attracted significant attention in recent years and has been used for novelty detection [2] (Liang et al. 2024) and sample selection (Jin and Candès 2023a,b; Wu et al. 2024). These works primarily use the conformal p-values for multiple testing while controlling the FDR. Bai and Jin [3] further proposes to select the optimal score function that maximizes testing power. In a similar spirit, we focus on selecting optimal bandwidth to maximize the power in novelty detection problem. As an extension to conditional testing, Wu et al. (2025) introduces the localized conformal p-value and applies it to several conditional testing problems. The data-enhanced localized conformal p-value proposed in this paper extends this work in a non-trivial way.
Experiment details
Since our goal is to test for novelties regarding , we only use for localization with true conditional dimension . In all experiments we take the Gaussian kernel with , and the candidate bandwidths DEL is take as . For the score function, we consider both the residual score with trained by the random forest algorithm and the quantile regression score with , and trained by the quantile forest algorithm. The density ratio estimator is fitted by training a GLM model with and as two classes. The probability output is taken as the function value of .
For the U.S. house price dataset, we first train a randomForest and a quantileForest on the full dataset to obtain residual scores and quantile regression scores, which are then used to identify outliers. After excluding these outliers from the main dataset, we partition the remaining observations into three subsets: 20% are allocated to the null test set, 40% to the calibration set, and the remaining 40% to the training set. Among the defined outliers, we randomly select 60% to serve as outlier observations. Subsequently, the null test set is combined with the selected outliers to construct the final test set. The feature Neighborhood is encoded as a binary indicator of high-price versus low-price areas according to SalePrice: the low-price neighborhoods include Edwards, OldTown and IDOTRR, while the high-price neighborhoods include Sawyer, Timber, NridgHt, CollgCr, NoRidge and StoneBr. The bandwidths are chosen as with for the LCP method, and for the DEL method.
Proof of theorems
Proof of Theorem 1
Since is permutation-invariant w.r.t. and therefore , we know the function is also fixed if we permute the set . Combined with the assumption that are exchangeable, we know are also exchangeable since they are obtained by applying a function invariant to permutations on . The remaining prove follows exactly the same to the proof of finite sample coverage of conformal prediction intervals:
where the third equality follows from the exchangeability.
Proof of Theorem 3
The estimation is
Denote , , then the difference is
Denote
Then
In the following steps, and will be calculated to show their order with Chebyshev’s inequality. For simplicity, we only consider follows since it only affect . For , we have
Where is a data point in calibration set. For the first term, we have
The inequality (i) holds because and the equality (ii) replace with . For the second term, following the same technique as in the first term we have
where is the conditional CDF of evaluated at given . Combine (C1) and (C2), with Chebyshev’s inequality, for large enough , we can get:
Then
For , we have
Where is a data point in test set. For the first term, we have
For the second term,
Combine (C4) and (C5), follow the same procedure as , we can get
The we find the order of by calculating , that is
So with Markov’s inequality, for large enough , we have
Then
For , we have :
In equality (C8), item of the first term and the second term have bounded expectation and item of the third term is , so by LLN, we derive . For , we have
The equation (i) relies on the continuity of density function. Combine (C3), (C6), (C7) and (C9), we have
Then the proof is completed. □
Proof of Theorem 4
Given the validity of data-enhanced p-values, the remaining proof is similar to the general proof of conditional calibration (Fithian and Lei [7]; Liang et al. 2024). Define the conditional statistic where denotes the unordered set of . We first prove that is still super-uniform given under the -th null hypothesis. This is obviously by the fact that are i.i.d. under the -th null hypothesis and conditional on the unordered set does not break the exchangeability.
Then we notice that the rejection set is fixed given . Given the unordered set and each test point with , the value of is fixed. So we have fixed given . Since is obtained by applying BH on , it is also fixed given .
Now we can analyse the FDR term-wisely. For each , let be the number of rejections of the algorithm if we replace with . We have
Here (i) and (ii) follows from conclusions that is valid given and is fixed given . Taking summation over leads to the FDR control conclusion. □
Proof of Theorem 5
By Algorithm 2, the optimal bandwidth is measureable with respect to . This indicates that with bandwidth is still super-uniform conditional on under the assumption that are exchangeable. Since the following conditional calibration procedure is exactly the same and each auxiliary p-value vector is computed with , the rejection set is still fixed given . Therefore, the remaining proof follows exactly the same to the proof of Theorem 4. □
Additional experiments
In this section we provide more experimental results to further illustrate the performance of different methods considered in this paper. Section D.1-D.8 contain additional simulation results. All simulations are performed on the same setting to that in § 4.1.1- § 4.1.2 with different varying parameters or algorithms. If not otherwise stated, the parameters will be the same to those in the main text.
Estimation of
We evaluate the performance of our methods with the density ratio function estimated using the SVM algorithm, in contrast to the GLM algorithm used in the main text. All other settings remain identical to those in the main text, with a fixed test sample size of .
Results in Table D1 show that SVM algorithm could lead to a worse estimator than the GLM for the residual score since DEL and DEL-fix both have power reduced with this algorithm. Although DEL-fix is severely influenced with the residual score, DEL mitigates this issue with an adaptive bandwidth. For the quantile score, DEL shows quite similar power across two algorithms, while DEL-fix is still negatively affected. For both scores, DEL is more robust compared with DEL-fix, showing the advantage of using adaptive bandwidths.
| Algorithm | Value | Residual score | Quantile score | ||||
| DEL | DEL-fix | UEL | DEL | DEL-fix | UEL | ||
| GLM | FDR | 0.153 | 0.113 | 0.108 | 0.153 | 0.134 | 0.119 |
| Power | 0.681 | 0.344 | 0.333 | 0.802 | 0.617 | 0.384 | |
| SVM | FDR | 0.106 | 0.019 | 0.112 | 0.154 | 0.118 | 0.126 |
| Power | 0.490 | 0.012 | 0.312 | 0.839 | 0.409 | 0.413 |
Table D1. FDR and power results with estimated by two kinds of algorithms. Bold numbers represent the best results.
Paramter
We investigate the influence of in our proposed methods by showing performance under different values of . The rest settings are fixed with .
From Table D2 we can see the value of only slightly influence the performance of our methods. Among all three values, DEL still achieves the highest power in most cases except for combined with the quantile score. In this case, the power of DEL and DEL-fix are quite close.
| Value | Residual score | Quantile score | |||||
| DEL | DEL-fix | UEL | DEL | DEL-fix | UEL | ||
| 0.25 | FDR | 0.157 | 0.120 | 0.118 | 0.154 | 0.140 | 0.125 |
| Power | 0.753 | 0.339 | 0.349 | 0.791 | 0.648 | 0.397 | |
| 0.5 | FDR | 0.154 | 0.134 | 0.116 | 0.154 | 0.148 | 0.140 |
| Power | 0.745 | 0.375 | 0.335 | 0.752 | 0.749 | 0.384 | |
| 0.75 | FDR | 0.151 | 0.139 | 0.117 | 0.160 | 0.153 | 0.138 |
| Power | 0.744 | 0.432 | 0.317 | 0.783 | 0.806 | 0.440 |
Table D2. FDR and power results under different values of . Bold numbers represent the best results.
Relationship between and
In § 2.2, we briefly discussed the choice of , noting that a larger should be preferred when the estimator is believed to be accurate. Here, we empirically validate this intuition using simulated evidence. Under the same setting as in § 4.1.2 with , we compare DEL with a variant that uses an oracle . Because obtaining the exact distribution of machine-learning–based scores is infeasible, we approximate the oracle by training it on an extensive leave-out dataset whose size is ten times larger than that used in the main experiments. We then record and compare the power curves of the two methods across different values of .
Figure D1 shows that DEL achieves relatively higher power when equipped with the oracle density ratio function compared to the estimated one. We also observe that the optimal choice of is around 0.6 for the oracle version, substantially larger than the optimal value of 0.1 obtained with the estimated version. This pattern provides empirical support for our proposed rule for selecting the parameter .
Figure D1. Power comparison of DEL using the estimated density ratio and its oracle counterpart. The dotted lines highlight the highest power attained by each method.
Novelty ratio
We compare our DEL method both with LCP, CP and our two simplified versions under different novelty ratios. We consider ratio in the range and keep the remaining settings as fixed with .
Table D3–Table D4 contains results under different novelty ratios in the test data. As the ratio increases, the signal becomes stronger and all methods have their power improved. Except for this pattern, the relative performance in all comparisons remain the same to simulation results in the main text.
| Ratio | Value | Residual score | Quantile score | ||||
| DEL | LCP | CP | DEL | LCP | CP | ||
| 0.1 | FDR | 0.153 | 0.148 | 0.108 | 0.153 | 0.200 | 0.119 |
| Power | 0.116 | 0.046 | 0.069 | 0.255 | 0.060 | 0.136 | |
| 0.15 | FDR | 0.146 | 0.206 | 0.095 | 0.145 | 0.193 | 0.143 |
| Power | 0.467 | 0.341 | 0.261 | 0.607 | 0.418 | 0.432 | |
| 0.2 | FDR | 0.155 | 0.193 | 0.131 | 0.158 | 0.179 | 0.163 |
| Power | 0.755 | 0.620 | 0.567 | 0.839 | 0.702 | 0.727 |
Table D3. FDR and power results under different novelty ratios for DEL, LCP and CP. Bold numbers represent the best results.
| Ratio | Value | Residual score | Quantile score | ||||
| DEL | DEL-fix | UEL | DEL | DEL-fix | UEL | ||
| 0.1 | FDR | 0.080 | 0.039 | 0.038 | 0.098 | 0.047 | 0.057 |
| Power | 0.119 | 0.035 | 0.026 | 0.217 | 0.093 | 0.045 | |
| 0.15 | FDR | 0.142 | 0.082 | 0.087 | 0.155 | 0.117 | 0.106 |
| Power | 0.477 | 0.140 | 0.135 | 0.594 | 0.351 | 0.173 | |
| 0.2 | FDR | 0.142 | 0.112 | 0.126 | 0.153 | 0.137 | 0.134 |
| Power | 0.668 | 0.346 | 0.329 | 0.799 | 0.611 | 0.399 |
Table D4. FDR and power results under different novelty ratios for DEL, DEL-fix and UEL. Bold numbers represent the best results.
Comparison with AdaDetect
We compare our proposed DEL method with AdaDetect under the same setting as Appendix § 4.1.1. In this experiment, we focus on the quantile scores, and both methods successfully control the FDR at the target level .
Figure D2 display the power of both methods under different test sample sizes. Since AdaDetect is designed for marginal novelty detection and does not incorporate conditional distributional information, its statistical power is substantially lower than that of DEL.
Figure D2. Power of DEL and AdaDetect under different test sample sizes .
Training sample size
We compare our DEL method with LCP, CP, and AdaDetect under varying training sample sizes , while fixing the test sample size at
and keeping the other settings unchanged. Here we focus on the quantile scores, and all methods successfully control the FDR at the target level.
Figure D3 shows that as the training sample size increases, all methods derive higher power since the prediction model becomes more accurate. In addition, DEL consistently achieves the highest power across different training sample size.
Figure D3. Power of different methods under varying training sample sizes .
Influence of covariate shift
In Theorem 1, we require the marginal distributions satisfy to ensure the DEL is valid in finite sample. Here we illustrate DEL is robust against certain degree of covariate shift. We take and consider both mean and variance shifts on the conditional variable . That is, instead of , we have or for the test data. The distribution of clean labeled data is still fixed as . The score function is taken as the quantile score.
Figure D4-Figure D5 show that even the condition does not hold, the DEL procedure can still control the FDR within a certain range of covariate shift. It can be observed from the figures that mean shift and enlarged variance do not result in FDR increase. If the variance is reduced, the FDR will tend to inflate the nominal level. However, it is still controlled around the nominal level even with a halved variance.
Figure D4. FDR and power of DEL when there is mean shift in the test covariates.
Figure D5. FDR and power of DEL when there is variance shift in the test covariates.
Categorical responses
Since we focus on regression settings in the main text, here we provide an example where is categorical. The data is generated as follows:
For inliers,
For outliers,
Therefore, there is conditional distribution drift between the inliers and outliers. We take with varying . The score function is taken as the probability output of a random-forest model trained on . The bandwidth for RLCP is taken as , and the candidate set for DEL is taken as . All the remaining parameters are the same to experiments in the main text.
Figure D6 exhibits the same qualitative pattern as Figure 1 in the main text. The key difference is that all methods show reduced power in this setting. This degradation is primarily due to the discrete nature of . Once becomes categorical, its conditional distribution given contains only two point masses, which substantially limits the amount of exploitable information in the detection procedure. Consequently, even when the inlier and outlier distributions differ significantly, the power is still below 0.5. In such scenarios, employing a well-calibrated predictive model with accurate probability estimates can be particularly beneficial.
Figure D6. FDR and power of different methods under the classification scenario.
References
- [1]Angelopoulos, A.N., Bates, S., et al.: Conformal prediction: A gentle introduction. Foundations and Trends® in Machine Learning 16(4), 494–591 (2023)
- [2]Bates, S., Candès, E., Lei, L., Romano, Y., Sesia, M.: Testing for outliers with conformal p-values. The Annals of Statistics 51(1), 149–178 (2023)
- [3]Bai, T., Jin, Y.: Optimized conformal selection: Powerful selective inference after conformity score optimization. arXiv preprint arXiv:2411.17983 (2024)arxiv.org/abs/2411.17983
- [4]Boukerche, A., Zheng, L., Alfandi, O.: Outlier detection: Methods, models, and classification. ACM Computing Surveys (CSUR) 53(3), 1–37 (2020)
- [5]Del Buono, F., Calabrese, F., Baraldi, A., Paganelli, M., Guerra, F.: Novelty detection with autoencoders for system health monitoring in industrial environments. Applied Sciences 12(10), 4931 (2022)DOI
- [6]Erfani, S.M., Rajasegarar, S., Karunasekera, S., Leckie, C.: High-dimensional and large-scale anomaly detection using a linear one-class svm with deep learning. Pattern Recognition 58, 121–134 (2016)DOI
- [7]Fithian, W., Lei, L.: Conditional calibration for false discovery rate control under dependence. The Annals of Statistics 50(6), 3091–3118 (2022)arxiv.org/abs/2007.10438
- [8]Fanaee-T, H.: Bike Sharing. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C5W894 (2013)
- [9]Guan, L.: Localized conformal prediction: A generalized inference framework for conformal prediction. Biometrika 110(1), 33–50 (2023)arxiv.org/abs/2106.08460
- [10]Hore, R., Barber, R.F.: Conformal prediction with local weights: randomization enables robust guarantees. Journal of the Royal Statistical Society Series B: Statistical Methodology, 103 (2024)DOI
- [11]Hong, C., Hauskrecht, M.: Mcode: Multivariate conditional outlier detection. arXiv preprint arXiv:1505.04097 (2015)arxiv.org/abs/1505.04097
- [12]Hariri, S., Kind, M.C., Brunner, R.J.: Extended isolation forest. IEEE transactions on knowledge and data engineering 33(4), 1479–1489 (2019)DOI
- [13]Hall, P., Wolff, R.C., Yao, Q.: Methods for estimating a conditional distribution function. Journal of the American Statistical association 94(445), 154–163 (1999)DOI
- [16]Jobe, J.M., Pokojovy, M.: A cluster-based outlier detection scheme for multivariate data. Journal of the American Statistical Association 110(512), 1543–1551 (2015)DOI
- [17]Kaggle: House Prices: Advanced Regression Techniques. https://www.kaggle.com/c/house-prices-advanced-regression-techniques. Accessed: 2025-08-31 (2016)
- [18]Lei, J., G’Sell, M., Rinaldo, A., Tibshirani, R.J., Wasserman, L.: Distribution-free predictive inference for regression. Journal of the American Statistical Association 113(523), 1094–1111 (2018)arxiv.org/abs/1604.04173
- [21]Liu, F.T., Ting, K.M., Zhou, Z.-H.: Isolation forest. In: Proceedings of the 2008 Eighth IEEE International Conference on Data Mining, pp. 413–422. IEEE Computer Society, Los Alamitos, CA (2008)DOI
- [23]Marandon, A., Lei, L., Mary, D., Roquain, E.: Adaptive novelty detection with false discovery rate guarantee. The Annals of Statistics 52(1), 157–183 (2024)arxiv.org/abs/2208.06685
- [24]Röchner, P., Rothlauf, F.: Unsupervised anomaly detection of implausible electronic health records: a real-world evaluation in cancer registries. BMC Medical Research Methodology 23(1), 125 (2023)DOI
- [25]Silverman, B.W.: Density Estimation for Statistics and Data Analysis vol. 26. CRC press, Boca Raton, FL (1986)
- [26]Song, X., Wu, M., Jermaine, C., Ranka, S.: Conditional anomaly detection. IEEE Transactions on Knowledge and Data Engineering 19(5), 631–645 (2007)DOI
- [27]Tibshirani, R.J., Foygel Barber, R., Cands, E., Ramdas, A.: Conformal prediction under covariate shift. In: Advances in Neural Information Processing Systems, vol. 32 (2019)arxiv.org/abs/1904.06019
- [28]Vovk, V., Gammerman, A., Shafer, G.: Algorithmic Learning in a Random World. Springer, New York (2005)
- [31]Zhang, Y., Jiang, H., Ren, H., Zou, C., Dou, D.: Automats: Automatic model selection for novelty detection with error rate control. In: Advances in Neural Information Processing Systems, vol. 35, pp. 19917–19929 (2022)DOI
AI tools statement
No AI-use declaration is available for this version in Valency.
The available record does not establish whether AI systems or models contributed to this work.









