<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Stanford University, Palo Alto, California,
USA, March</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Threshold Optimization in Multiple Binary Classifiers for Extreme Rare Events using Predicted Positive Data</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dataset IEEEFraud</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Edgar Robles , Fatima Zaidouni , Aliki Mavromoustaki, Payam Refael Univeristy of Costa Rica, San Jose ́, Costa Rica University of Rochester</institution>
          ,
          <addr-line>Rochester, NY</addr-line>
          ,
          <institution>USA Institute of Pure and Applied Mathematics, University of California Los Angeles, CA, USA Google Inc.</institution>
          ,
          <addr-line>Los Angeles, CA</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <volume>2</volume>
      <fpage>3</fpage>
      <lpage>25</lpage>
      <abstract>
        <p />
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Binary classification is challenging when dealing with
imbalanced data sets where the important class is made of
extremely rare events, usually with a prevalence of around
0.1%. Such data sets are common in various real-world
problems. Examples are medical diagnostics where the disease
is considered a rare event, or multiple types of fraud
detection where regular transactions are the most prevalent. The
events are categorized as either predicted positive or
predicted negative against a certain threshold. In large
imbalanced data sets, it is expensive to verify, through human
raters, all the predictions made by the classifier. As a result,
only predicted positive events are rated. Additionally, in most
industrial applications, it is useful to combine multiple
classifiers to make a decision. We developed a machine learning
pipeline which, combined with expert knowledge, decides on
an optimal threshold. ROC curves are reformulated to true
positive (TP) versus false positive (FP) curves. We propose
two solutions to select an optimal threshold by maximizing
the area under the curve (AUC): a graph-based approach and
an analytic approach. The graph-based approach constructs a
graph to select an optimal path in the threshold space and the
analytic approach minimizes an energy function. Our results
agree with the Google team’s manual attempts to choose the
operating point in their private data sets and binary classifiers
while providing a rigorous mathematical framework. Our
solutions built on the Google team’s expert knowledge efforts
which identified the marginal precisions used in our methods.
To further evaluate the performance of our algorithm, we split
3 public data sets into training and testing sets and used them
to train five different classifiers. The results show
improvement of the f-1 measure by 1.5%, the precision was improved
by an average of 5.1% and, the recall was reduced by 1.6%
on average. Depending on the purpose of the classification,
we show how to reverse this trade-off.</p>
      <p>Co-First authors: Both authors contributed equally to this
work.</p>
    </sec>
    <sec id="sec-2">
      <title>Introduction</title>
      <p>
        Our study focuses on data sets with extreme rare events,
where the minority class accounts for 0.01% to 0.19% of
the population. Such data is very common in many
applications including fraud detection where fraudsters constitute
a small percentage of users, medical diagnostics, face
detection, money laundering, and intrusion detection. In such
data sets, the distribution of positive to negative classes is
extremely imbalanced and it is typically more important to
correctly detect the positive class
        <xref ref-type="bibr" rid="ref1">(Aggarwal 2014)</xref>
        that
corresponds to the rare events. For instance, one of the examples
used in the result section is a public data set on credit card
fraud detection where the positive class accounts for 0.17%
of all transactions.
      </p>
      <p>In the rest of this paper, we provide some background about
binary classifiers and their performance, we summarize
related work and describe the problem statement in detail.
Then we propose solutions for single classifier
thresholding and for an ensemble of classifiers where two methods
are proposed; the analytic and graph approach. Finally, we
explain two experiments to benchmark our results and
evaluate the performance of our algorithm, one using public data
sets, and the other one using private Google data sets.</p>
    </sec>
    <sec id="sec-3">
      <title>Background</title>
      <sec id="sec-3-1">
        <title>Binary Classifiers</title>
        <p>A binary classifier is a model that classifies its input into
two classes; a positive and negative class. In this paper, we
call the classifier’s input a document, and its output a score.
The higher the score, the more the classifier is confident
that the document is in the positive class and vice versa. In
the threshold binary model, a threshold number is picked
and compared to the output score of the classifier to decide
which class is predicted. If the score is larger than the
selected threshold, the document is classified in the positive
class. If the score is lower than the threshold, the document
is classified in the negative class.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Classifier performance</title>
        <p>To evaluate the performance of the classifier, the documents
are often presented to human raters to determine the true
positives, the false positives, and the true and false
negatives. A higher threshold will cause the predicted class to
become more precise on average while losing some recall and
a lower threshold will cause the predicted class to become
less precise on average while gaining some recall. Note that:
Precision =</p>
        <p>T P + F N
This results in a trade-off where a very low threshold might
yield many false positives and a high threshold might yield
many false negatives. This trade-off is usually visualized
with a receiver operating characteristic (ROC) curve that
plots the true positive rate (TPR), defined as
versus the false positive rate (FPR), defined as</p>
        <p>T P R =
F P R =</p>
        <p>T P
T P + F N</p>
        <p>
          F P
F N + T P
;
;
as suggested in
          <xref ref-type="bibr" rid="ref3">(Bradley 1997)</xref>
          and
          <xref ref-type="bibr" rid="ref12">(Provost and Fawcett
2001)</xref>
          . A random classifier would be located along the main
diagonal
          <xref ref-type="bibr" rid="ref9">(Fawcett 2006)</xref>
          and a good classifier would have
points in the upper left corner. This is visualized in Figure 1.
A widely used performance measurement is the area under
the curve (AUC) of the ROC. An optimal threshold is needed
to minimize the false positives and negatives by maximizing
the AUC.
        </p>
        <p>False positive rate
1.00</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Related Work</title>
      <p>
        ROC and precision-recall analysis are widely used in
imbalanced data set classification, as shown in various types
of rare event data sets in
        <xref ref-type="bibr" rid="ref11">(Kubat, Holte, and Matwin 1998)</xref>
        ,
        <xref ref-type="bibr" rid="ref16">(Weiss 1999)</xref>
        , and
        <xref ref-type="bibr" rid="ref6">(Carvalho and Freitas 2002)</xref>
        . However,
choosing an optimal threshold also called “optimal
operating point”, is only well-understood for balanced data
sets where there are approximately as many positives as
negatives. A standard method is to take the intersection of
the iso-performance tangent line in the ROC as the optimal
1.00
e
t
a
r
e
v
iit
s
o
p
e
u
r
T
0.00
0.00
ROC
random
good
be er
ideal
cut-off
        <xref ref-type="bibr" rid="ref10">(Hong 2009)</xref>
        . The challenge arises when dealing
with imbalanced data sets where rare events constitute the
positive class.
      </p>
      <p>
        The iso-performance line method maximizes the
classification accuracy, which places more weight on the majority
class, therefore overlooking the minority class in which
we are interested the most. This method is therefore not
applicable in our case, its pitfalls are discussed in detail in
        <xref ref-type="bibr" rid="ref5">(Calabrese 2014)</xref>
        and
        <xref ref-type="bibr" rid="ref8">(Fawcett and Provost 1996)</xref>
        .
Optimizing the threshold as a method to improve classification
accuracy was explored in
        <xref ref-type="bibr" rid="ref18">(Weiss 2004)</xref>
        and
        <xref ref-type="bibr" rid="ref13">(Provost 2000)</xref>
        where rarity is explored and the challenges that it implies
are investigated. In
        <xref ref-type="bibr" rid="ref15">(Weiss and Provost 2003)</xref>
        , the authors
show that adjusting decision thresholds is an efficient way to
deal with this bias. In
        <xref ref-type="bibr" rid="ref5">(Calabrese 2014)</xref>
        , the author suggests
a quality measure called the cost-sensitive unweighted
accuracy which uses the true rate as defined in
        <xref ref-type="bibr" rid="ref10">(Hong 2009)</xref>
        as a quality criterion. It finds the optimal threshold that
minimizes the difference between the simple mean of the
Type 1 error, associated with false positives, and Type 2
error associated with false negatives. To correct for the
imbalanced misclassification costs, the errors are weighted
by their respective costs for which the ratio is usually
known. An example using this method is found in
        <xref ref-type="bibr" rid="ref14">(Roelens
et al. 2018)</xref>
        for flood prevention data.
      </p>
      <p>
        In the context of credit card assessment, an MCDM
(Multiple Criteria Decision Making) was proposed in
        <xref ref-type="bibr" rid="ref2">(Beulah
Jeba Jaya .Y 2015)</xref>
        to select an optimal probability cut-off
using hybrid data mining approaches.
      </p>
      <p>
        Ensemble classifiers are common methods to combine
multiple classifiers, each one looking at different features of
a dataset. In
        <xref ref-type="bibr" rid="ref4">(Breiman 2001)</xref>
        , a method is shown where a
group of poor classifiers can be harnessed together to obtain
a way better performance.
        <xref ref-type="bibr" rid="ref7">(Dietterich 2000)</xref>
        shows how
different methods for voting in these ensembles of classifiers,
from bayesian averaging to error-correcting, output coding,
and boosting can often perform better than a single classifier.
      </p>
      <p>Different thresholding methods were suitable for a range
of applications, we identified few very important challenges,
described below, that are faced when dealing with rare event
data sets, which were not addressed before, in our
knowledge.</p>
    </sec>
    <sec id="sec-5">
      <title>Problem Description</title>
      <p>In an extreme rare event problem, if one positive event
happens in every ten thousand samples, one would have to
label a million samples to detect 100 positive events. Like the
data we are dealing with from Google, many datasets will
lack information about the true and false negatives, because
it is very expensive to have humans spend time rating such a
large amount of data. Therefore, it makes sense that the only
data classified by humans is the data that scored higher than
a given score on the classifier i.e the positive class.
Unfortunately, not knowing the true and false negatives, therefore,
calls for analysis methods that do not require them.</p>
      <p>The second important challenge to address occurs when
using multiple classifiers to evaluate a single document. It
often happens that we need to look at different aspects of
the document using different classifiers before making a
decision. For instance, one classifier can be assigned images
and another classifier can look for text. Each classifier will
output a different score and after a threshold is chosen, it can
be compared to each of the score and a decision can be made
about whether the document belongs to the positive or
negative class. The difficulty arises in finding a threshold that
optimizes all the models jointly. This takes us from a
singledimensional optimization problem to a multi-dimensional
one. In the following sections, we will explore the
methods developed to address these challenges in the context of
extreme rare event data sets.</p>
    </sec>
    <sec id="sec-6">
      <title>Proposed Methods</title>
      <sec id="sec-6-1">
        <title>For a single classifier</title>
        <p>For the sake of completeness, we begin with the simple case
of one classifier where we start defining the framework of
our methods.</p>
        <p>Let Xi be the independent and identically distributed (iid)
random variable representing the score of positive
documents. The number of true positives at a threshold t is
the number of positive documents greater than the score t.
Hence, for each threshold t we have TPR as:</p>
        <p>n
1 X IXi t;
n</p>
        <p>i=1
1 m
where n is the total number of positive samples and IXi t is
the indicator function. Similarly, let Yi be the iid random
variable of the score of negative documents, then FPR is
given as:</p>
        <p>X IYi t;
m</p>
        <p>i=1
where m is the total number of negative samples. The ROC
curve is then parametrized as
m
1 m</p>
        <p>n !
X IYi t; n1 X IXi t ; t 2 R;
i=1 i=1
and is expected to converge to (P (Yi t); P (Xi t)). The
trade-off optimization problem then becomes one of
finding a threshold t that maximizes P (Xi t) and minimizes
P (Yi t). However, as mentioned in the introduction, we
are addressing the situation where only the portion of the
documents having scored higher than a certain threshold are
rated. In other words, the distributions are left-censored, we
only have IXi t; IYi t for t 0 and we only know the
total number of sample m + n but do not have knowledge of
either m or n. Hence, we are unable to plot an ROC curve.</p>
        <p>Since we lack information about the true and false
negatives, we use a reformulation of the ROC curve that plots
TP instead of TPR and FP instead of FPR , this removes
the normalization to probabilities that a normal ROC does
by dividing by the positives or negatives. The reformulation
is referred to as the positive-negative (PN) curve as defined
in [8]. In our paper, we also refer to it as a partial ROC
curve. The appearance is the same between the PN and ROC
curve, but the chance-line (diagonal) in the ROC becomes
the break-even line as known in information retrieval, a more
detailed explanation is given in [8].</p>
        <p>Mathematically,
m</p>
        <p>n
X IYi t; X IXi t ; t 2 R 0;
i=1 i=1
!
where m and n are the total number of positives and
negatives, respectively, having scores greater than 0 for instance.</p>
        <p>Given a classifier, a low threshold T can be set, the
documents with a score higher than T can be sent to human raters
to determine the TP and FP, then in the resulting data set,
the threshold is raised to see how the TP and FP change.
Note that as the threshold keep getting higher, we would
have fewer data points in the sub-sample and therefore a
wider confidence interval. Using the partial ROC curve
implies that we can not use the rated data to simulate the TP
and FP count had the model threshold been set even lower
than T.</p>
        <p>With the partial ROC curve, we can formulate our
optimization problem as follows:
Given any point on the curve, if this point was the
operating point and we wanted to get one additional true positive
document, we can determine the cost that we need to pay in
terms of a raw number of false positives.</p>
        <p>In many situations, this formulation can relate to a
business goal. For example, the positive class could be unwanted
documents that a company needs to filter out without losing
the wanted documents. Thus, they can provide a number to
quantify how many good documents they are willing to give
up in order to filter out one additional bad document. This
can be answered by analyzing monetary costs for instance.
Based on this, a target derivative FT PP can be chosen, again
this represents the amount of false positives gained vs the
amount of true positives gained at a certain threshold. The
target derivative is based on expert knowledge, which was
provided for us by Google in our application.</p>
        <p>A partial ROC curve can be described as a parametric
function</p>
        <p>f (t) = (F P (t); T P (t)); where f : T ! R2;
where T is the threshold space. A fit can be applied to find
the points where the derivative has the desired value. In the
result section, we present the fitting methods that worked
best for typical partial ROC curves.</p>
      </sec>
      <sec id="sec-6-2">
        <title>For an ensemble of classifiers</title>
        <p>In this case, the PN curve (partial ROC) becomes an
Ndimensional manifold, ddFT PP becomes a more complicated
notion since a local direction must be picked for a unique
derivative to exist.</p>
        <p>In general, one can define the function as
f (~t) = (F P (~t); T P (~t)); f : T^ ! R2;
(1)
where T^ is the threshold space described by the cross
product of all the threshold values for each classifier.
We can consider the derivative at a point to be:
lim
x!0</p>
        <p>TP
FP
u
u
;
where u is a vector that describes the direction at which
the derivative is being taken.</p>
        <p>We describe a path
(s) = (g(s); h(s)) for 0
s
1
over T^ space, that is, a function : [0; 1] ! T^.</p>
        <p>We impose the following restrictions on for the resulting
curve to behave like a partial ROC curve:
(0) = (inf T1; inf T2; : : : ; inf Tn)
(1) = (sup T1; sup T2; : : : ; sup Tn)
f (t) and g(t) must be monotonous</p>
        <p>The first two conditions are so that the curve starts and
ends at the correct points, and the last point is so that the
amount of true positives and false positives decrease with
respect to our new “threshold”.</p>
        <p>To pick the best classifier, should maximize the area under
the curve:
argmax</p>
        <p>T P dF P
Z</p>
        <p>([0;1])</p>
        <p>We propose two algorithms to find , one is based on
minimizing a function (the analytic approach) and the other one
is based on building a graph (the graph approach).</p>
        <p>Before we give a step by step example implementation for
both methods, we introduce the following simple base
algorithm for both methods to find the optimal operating point.
Algorithm 1 Base algorithm for finding the optimal
operating point
Input: Set of points P representing (T P; F P; T 1; T 2; :::),
target derivative d
Output: Optimal operating point (T 1; T 2; :::)
1: C FindOptimalCurve(P )
2: Find point q where ddt C(q) = d</p>
      </sec>
      <sec id="sec-6-3">
        <title>3: return q</title>
        <p>In what follows, we explain the FindOptimalCurve
function used in Algorithm 1 in the context of both the analytic
and graph approach.</p>
      </sec>
      <sec id="sec-6-4">
        <title>Analytic approach</title>
        <p>The core of this approach is the usage of a family of
functions for which we optimize the parameters in a way that
maximizes the area under the corresponding PN curve. This
approach estimates the integral yielding the area under the
curve using the simple trapezoidal method. The algorithm
implementation is summarized in Algorithm 2.</p>
        <p>We describe the implementation of this algorithm in more
detail using two thresholds, as an example, in the following
steps:
Algorithm 2 Analytic implementation of
FindOptimalCurve
Input: Set of points P representing (T P; F P; T 1; T 2; :::),
a family of curves fp defined on [0; 1] ! T
Output: A curve C
1: Fit a function F^(T 1; T 2; :::) as the best fit for the points
(F P; T 1; T 2; :::)
2: Fit a function T^(T 1; T 2; :::) as the best fit for the points
(T P; T 1; T 2; :::)
3: Let gp (T^; F^) fp
4: q argmaxpAU C(gp(t))dt
5: return f(t; fq (t))8t 2 [0; 1]g</p>
        <sec id="sec-6-4-1">
          <title>1. Normalizing the thresholds</title>
          <p>2. Plotting the three-dimensional plots (TP, T1, T2) and (FP,
T1, T2) and fitting a surface through each one of them
using an interpolation technique. We create an n n grid
on the threshold plane with each point on the grid
corresponding to a pair of thresholds and a value of TP and FP.
This step allows finding the estimators T^P and F^P at each
point of the surface.
3. Turning the grid into a linear space; since the data is
normalized at this point, the domain will be from 0 to 1. We
can also specify the granularity i.e the size of the
partitions in this domain. In the next steps, the granularity will
also indicate the number of AUC samples that are
calculated in the process.</p>
          <p>This step is the start of the parametrization used in this
approach. If s denotes the parameter indicating the order
of the partitions, then both thresholds are a function of s
which is then used as an index in a separate parametric
function to output the corresponding TP and FP values
separately.</p>
        </sec>
        <sec id="sec-6-4-2">
          <title>4. Defining an energy function as follows:</title>
          <p>E(p~) = AUC(F^P
p~; T^P
p~)
where:</p>
          <p>p~ is a family of parametric functions defined from [0,1]
to T1 T2 with p~ being the parameter. In our algorithm, we
used a parametric function that is graphically close to the
resulting discrete path and that passes through the bounds
(0,0) and (1,1):
p~ = xp
(2)
AUC is a function that calculates the area under the curve
using the trapezoidal formula, this is an estimation of the
integral form of the calculation of the area under the curve
described by: Rf(x; p~(x))g TP dFP
5. Minimizing the function below using the Nelder-Mead
minimization function.</p>
          <p>log(log(E))</p>
          <p>Note that we made the previous function negative so we
can use a minimization method to maximize the AUC. We
also composed E with two logarithms in order to make
it converge faster, otherwise, it might get stuck on local
minima.
6. Creating a function that determines the curve in the
TPFP space that corresponds to the resulting path within the
threshold space using the parameterization mentioned in
Step 3.
7. Finding the point s where ddFT PP w.r.t. the parameterization
s equals the target marginal precision, by estimating the
derivative of f .
8. Finding the optimal operating point (T1,T2,TP,FP) given
a target marginal precision ie. the values of t where
(t) = s. It can be interpolated at the value of s given
by the closest marginal precision to the target.Ridders
method can be used for root finding to get the best
parameter s.</p>
        </sec>
      </sec>
      <sec id="sec-6-5">
        <title>Graph-based approach</title>
        <p>The goal of the graph-based approach is again to find the
continuous path on the threshold space that maximizes the
area under the curve in the TP-FP space, now with the
constraint that every point is only allowed to move through its
neighbors.</p>
        <p>We defined the node, edge, and weight of the graph shown
in Figure 2, for 2-dimensions, as follows:</p>
        <p>Node v: represents a pair of thresholds, having attributes
of (T1,T2,TP,FP)
Edge e: the connection between the nodes is established
if and only if one of their thresholds is equal or their other
threshold is consecutive in the discrete set of thresholds.
Weight of edge e = (v1; v2): this is equal to the
negative of the area under the segments (trapezoid)
(FP(v1); TP(v1)) and (FP(v2); TP(v2)) as shematized
in Figure 3. Mathematically, the weight is defined as:
w(e) =</p>
        <p>Then the total weight of edges in a path is the negative
of the area under the curve swept out in the TP vs FP plot.
In another words, by fixing end points, we can find a better
TP vs FP curve by finding a path that has a minimal weight.
So, it suffices to find the shortest path from v0 to v1 ,with
(t1(v0); t2(v0)) = (0; 0) , (t1(v1); t2(v1)) = (1; 1) .
Intuitively, it finds a shortest path from the left bottom corner
to the right upper corner in the thresholds space T1 T2 .
The edge is directed towards up or right to avoid bent paths
in the corresponding TP vs FP curve.</p>
        <p>After we find the set of nodes in the shortest path, we
connect the corresponding points and re-parametrize the path.
Note that it would be continuous but not smooth.
The algorithm for this method is the following:
Algorithm 3 Graph based implementation of
FindOptimalCurve
Input: Set of points P representing (T P; F P; T 1; T 2; :::)
sampled in a grid with respect to the thresholds
Output: A curve C
1: Create a graph G connecting points to neighbors with a
greater coordinate than them
2: Let the origin be A0 and the point with the biggest
coordinates be A1
3: P FindOptimalPath(G; A0; A1)
4: Let f (t) : [0; 1] ! F P T P such that it passes through
the path P
5: return f(t; f (t))8t 2 [0; 1]g</p>
        <p>Below we explain this approach in detail, starting from
step 3 of the analytic approach for a 2-dimensional example,
since the first two steps are similar.
1. Transforming the threshold space into an n n grid with
each point on the grid corresponding to a pair of
thresholds and a value of TP and FP.
2. Calculating the weight of the graph as the negative area
under the segment formed by 2 points v1; v2 in the TP vs
FP curve using equation 3
3. Determining the weight of the edge connecting the node
of two consecutive points.</p>
        <p>Note that the predicted positives have to be non-negative,
hence the segment is above the x-axis. The weight is
non-positive therefore a lower weight indicates a higher
area under the segment.
4. Store the (TP; FP; T1; T2) tuple in every node as extra
information. The edge can then be defined as a 3-tuple of
(nk; nl; wk;l), where nk and nl are each node and wk;l is
the negative area under the curve of each node.</p>
        <p>The nodes are connected if they are within the same
neighborhood. A function can do so if the one of the
thresholds is the same between two neighbours or the
thresholds are consecutive to each other in the discrete
set of thresholds.</p>
        <p>The path selected is therefore just a collection of nodes
from the left bottom to right upper corner in thresholds
space and the total weight of the path corresponds to the
negative area under the curve swept out by it in the TP
FP space.</p>
        <p>Note that in order to compute the shortest path
between the lower-left corner (source node) to the top
right corner node, the Bellman-Ford algorithm can be
implemented since it accepts edges with negative weights
unlike the usual Dijkstra’s algorithm.
5. Connecting the nodes to obtain a continuous path in the
threshold space and determining the curve in the TP-FP
space that corresponds to the selected path. It does so
using the same parametrization explained in step 3 of the
analytic approach.
6. Getting the marginal precision, refer to step 7 of the
analytic approach.
7. Determining the optimal operating point given a target
marginal precision, refer to step 8 of the analytic
approach.</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Experiments and Results</title>
      <sec id="sec-7-1">
        <title>Evaluating the performance using public datasets</title>
        <p>To evaluate the performance of the method, we use rare
event data sets where the amount of false negatives and true
positives can be calculated, in order to compare the
precision and recall of two standard classifiers with our methods
on the resulting ensemble of classifiers. This was done using
three rare event datasets123 whose true and false positive and
negative values are known.</p>
        <p>Each dataset was cleaned by changing empty values for
the average value in the column, turning categorical datasets
into one-hot encoded vectors, and encoding cyclical values
like days of the weeks into points in a unit circle. These
datasets were then passed through a PCA procedure
(Principal Component Analysis) to reduce the dimensionality. The
data sets were then split into a training set T and a holdout
testing set H, where T represents 75% of the data set and H
represents the other 25%.</p>
        <sec id="sec-7-1-1">
          <title>1https://www.kaggle.com/mlg-ulb/creditcardfraud 2https://www.kaggle.com/henriqueyamahata/bank-marketing 3https://www.kaggle.com/c/ieee-fraud-detection</title>
          <p>Each classifier was trained using the first 20% of the
components of the PCA. We need to simulate a joint
optimization of two classifiers where each one of them makes
decisions over a separate but related data set. Thus, one of the
classifiers was assigned the remaining even components and
a second classifier of the same type was assigned the
remaining odd components.</p>
          <p>The hyperparameters, for each classifier, were tuned by
maximizing the average accuracy in a cross-validation test.
A cross-validation test was done by splitting the training
set T into 5 different cross-validation groups: T1; T2; :::T5,
where for each training set Ti, a classifier is trained using
the set Sj6=i Tj and the score for the ith fold is denoted by
si and is obtained by evaluating the accuracy of the classifier
on Ti. The hyperparameters with the highest average value
of s1; :::; s5 are picked.</p>
          <p>The classifiers used for the testing were Linear SVMs,
Random Forests, Decision Trees, k-nearest neighbors,
XGBoosting and Naive Bayes.</p>
          <p>We explored multiple classification techniques to
determine whether our methods improve their performance. We
relied on (Pedregosa et al. 2011) for a compilation of
classification algorithms. In all classifiers, we estimated the
hyperparameters through a grid search with cross-validation.
For the k-nearest neighbors classifier, we tested all the
values of k from 1 to pn where n is the number of points
in the training data, as well as the L1 and L2 metrics, the
default behavior for classification, is to pick the class with
the biggest number of nearest neighbors assigned to them.
The decision tree classifier used the grid search coupled with
the Gini and entropy criterion. We optimized the maximum
depth parameter for all integer values between 1 and 500 as
well as without setting a maximum depth, the default
classification method is to follow the instructions for the tree.
The random forest classifier also used the Gini and entropy
criterion with the number of estimators between 50 and 500,
with steps of 10 between them, the default behavior for
classification is to let each decision tree in the forest vote, and
the class with the most votes wins. For the extreme gradient
booster (XGboost), we used a maximum depth from 1 to 20,
a learning rate from 0.1 to 1, with steps of 0,1, and a number
of estimators from 50 to 500 with a step of 10, the default
classification behavior is the same as random forests. For
the linear SVMs, we again used the grid-search with
crossvalidation to look for the hyperparameters between using L1
and L2 norm for the penalty, the default threshold used was
0. For SVMs, we used the hinge or squared hinge loss
functions to train the classifier with a dual true or false and using
all values of the regularization parameter from 0 to 1 with
a step of 0.1, the default threshold is 0. We also used a Naive
Bayes classifier with no optimized parameters, whose
default classification behavior is to choose the class with the
highest probability.</p>
          <p>A grid was made using the result of the cross product of
the thresholds of equally spaced points in each dimension.
An input would be considered to have a true value if either
of the scores produced by each classifier surpassed their own
threshold. This means that we are taking the union of the
classification. Using the scores outputted by the classifiers,
we calculated the amount of false positives and true positives
for each pair of thresholds in the grid. This was the input
for Algorithm 1. We then calculated the precision and recall
from the testing set.</p>
          <p>To evaluate their performance, the F1 measure was used
instead of the accuracy score. This latter is not suitable for
rare event data sets where a difference in accuracy of 0.01%
can make a huge difference in both the precision and recall.
The F1 measure is calculated by</p>
          <p>F1 = 2</p>
          <p>pr
p + r
;
where p is the precision and r is the recall.</p>
          <p>Figures 4, 5 and 6 show the F1 measure, precision, and
recall, respectively, for each experiment. An experiment was
defined as a combined pair of a dataset and a classifier type.
When either the precision or recall were extremely low, the
other quantity is ”undefined”. In this case, taking the union
of the classifiers’ decisions results in classifying every
document as positive, which makes the ensemble classify every
document as positive.</p>
          <p>Overall, the precision was increased on average by 5.1%
while the recall was reduced by an average of 1.6% and F1
measure increased by an average of 1.5%.</p>
          <p>Table 1 and Table 2 of the appendix show the results for
all the simulated experiments with all the mentioned
classifiers. Undefined values are showed as - on the tables. As the
F1 measure of the classifiers that do not use the proposed
methods increases, the F1 measure of the ensemble
resulting from the proposed methods also increases. This trend
is shown on figure 7. It also plots the identity line to show
that the proposed methods improve the F1 measure of all the
points above this line.</p>
        </sec>
      </sec>
      <sec id="sec-7-2">
        <title>Benchmark using Google data sets</title>
        <p>The Google data contains 22 data sets each consisting of
about 10,000 rows and 4 columns of data. The two first
columns represent two thresholds of two different classifiers
and the next two represent the number of true and false
positives for each pair of thresholds as determined by
human raters, assuming all documents over the threshold is
considered as part of the positive class. These datasets, have
a prevalence of the positive class of about 0.01% of the total
number rows.</p>
        <p>The result of running Algorithm 2 and 3 is shown in
Figure 10 for an example data set. The figure represents the
threshold paths obtained using both the analytic and graph
approach, as well as the location of the operating point.</p>
        <p>Using the parameterization from Equation 1, we can use
the threshold paths to determine the optimal partial ROC
curve that was selected by each of these algorithms.</p>
        <p>Next, we can determine the optimal operating point given a
target marginal precision as determined by a business goal
set by Google’s expert knowledge efforts prior to this work.
The result of running Algorithm 1 is shown for 3 different
methods in Figure 8 in the threshold space and
correspondingly in Figure 9 in TP vs FP space.</p>
        <p>The analytic and graph methods mentioned in figures 8
and 9 are the proposed methods, while the benchmark is a
fine-tuned operating point used by Google based on
separating the false positives into small intervals called buckets,
and picking the highest TP for each bucket, then adjusting
this manually to fit the goals of the optimal operating point.
While this latter is good as a benchmark for our algorithms,
it can not be used as another optimization method since it
lacks mathematical rigor and produces an erratic behavior in
the threshold space which, without fine-tuning, would imply
the non-existence or non-uniqueness of the derivative of the
partial ROC curve needed to find the operating point.
Our methods make a good attempt at approximating the
operating point selected by the benchmark method. These
points are also plotted on their respective paths in Figure 10.</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>Discussion</title>
      <p>We used an or (union) in combining the decisions of the
classifiers but it can be substituted by an and operation
depending on whether the application prioritizes positive
classification or negative classification. Our methods also assume
that the ROC curve for both of the classifiers has a unique
decreasing derivative which can be expected from a tuned
classifier.</p>
      <p>Both the analytic and graph methods were presented as
although both useful, there are different disadvantages to each
one of them. The analytic method is heavily dependent on
the family of functions used to optimize over, and is prone
to get stuck in an optimal minimum. On the other hand, it
is uncertain whether the graph method is prone to
overfitting to the data or not, however, unlike the analytic method,
there is no way to mitigate it. A possible alteration to be
done to mitigate overfitting with the graph method would be
to hold a series of simulations where some connections
between the nodes are deleted, and then picking the average
path between the resulting set of paths.</p>
      <p>Both algorithms scale reasonably well with respect to the
amount of data. The graph algorithm scales at a rate of
O(nk), where n is the number of rows and k is the
number of classifiers. This is good when the number of
dimensions is low, however, it scales exponentially with the
number of classifiers in the ensemble. The analytic approach
works the opposite way since it depends on an
optimization problem, it does not scale very well with respect to the
number of rows, however, it scales linearly with the number
of dimensions. We compared the running time of the
algorithms using a computer with an i7-6700 and 32GB of RAM
for all the Google data sets combined. The analytic approach
ran on average 10 times faster than the graph approach; for
n = 10; 000 and k = 2, the analytic method takes 60
seconds while the graph method takes 6 seconds in our
conditions.</p>
      <p>Finally, the experiments were done using an automated
method to tune the classifiers, notably the grid-search with
cross-validation in order to obtain a large number of samples
across different accuracies. However, this could be improved
since it does not reflect a real-world application of this
process in which the hyperparameters would be estimated with
the help of additional fine-tuning methods that depend on
the specific application of the data set.</p>
    </sec>
    <sec id="sec-9">
      <title>Conclusion</title>
      <p>The proposed algorithm finds optimal thresholds for the
output of binary classifiers used for rare event datasets. The
method works by finding the best possible path in the TP
- FP space, which is the one that maximizes the area under
the curve of the projected partial ROC curve. This curve is
then used to find the optimal operating point corresponding
to a given target derivative. The latter represents the
tradeoff of lost false positives to gained true positives which was
obtained from the Google team’s expert knowledge efforts
prior to this work. Two optimization methods are proposed:
an analytical method, which optimizes parameters of an
energy function and a graph method, which performs the
optimization through finding the path in a graph to maximize
the AUC.</p>
      <p>Our results were very close to the optimal operating
points that were picked manually by the Google team. We
were, therefore, able to automate their process of finding
an optimal threshold while providing a mathematical
framework and using their target derivatives(marginal precisions).
Moreover, we compared the F1 measure, precision, and
recall of combining five classifiers and three datasets while
either relying on our thresholding methods and taking the
union of the decisions or using the classifiers individually
with their default classification behavior. The result
improved the precision while lowering the recall less
significantly. This tradeoff could be reversed, if desired, by
simply changing the ensemble decision between the individual
classifiers from ’or’ to ’and’. We discussed important
limitations and possibilities for future work. Notably, optimizing
different metrics other than AUC individually or in
combinations would be worth exploring. Moreover, we optimized
two binary classifiers jointly but the theoretical framework
described in the methods section extends to N dimensions.
Using this in practice will require optimizing over
multiple parameters in the analytic approach and extending the
graph to an N-dimensional lattice. Exploring this possibility
through practical applications might open great avenues for
the general optimization of ensemble classifiers.</p>
    </sec>
    <sec id="sec-10">
      <title>Acknowledgements</title>
      <p>We would like to thank our teammates Ching Pui Wan and
Joanne Beckford, NSF grant DMS-0931852, Payam
Refael and his team from Google, our academic mentor Aliki
Mavromoustaki, and all of the IPAM staff at UCLA for
making this work possible.</p>
      <p>Machine Learning</p>
    </sec>
    <sec id="sec-11">
      <title>Appendix</title>
      <p>Ensemble
k-nearest neighbors</p>
      <sec id="sec-11-1">
        <title>Naive Bayes LinearSVM Decision Tree Random Forest</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Aggarwal</surname>
            ,
            <given-names>C. C.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Data classification: algorithms and applications</article-title>
          . CRC Press, Taylor &amp; Francis Group.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <given-names>Beulah</given-names>
            <surname>Jeba Jaya</surname>
          </string-name>
          .Y,
          <string-name>
            <surname>J. J. T.</surname>
          </string-name>
          <year>2015</year>
          .
          <article-title>Multiple criteria decision making based credit risk prediction using optimal cutoff point approach</article-title>
          .
          <source>International Journal of Applied Engineering Research</source>
          <volume>10</volume>
          :
          <fpage>20041</fpage>
          -
          <lpage>20054</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Bradley</surname>
            ,
            <given-names>A. P.</given-names>
          </string-name>
          <year>1997</year>
          .
          <article-title>The use of the area under the roc curve in the evaluation of machine learning algorithms</article-title>
          .
          <source>Pattern recognition 30</source>
          <volume>(7)</volume>
          :
          <fpage>1145</fpage>
          -
          <lpage>1159</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Breiman</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <year>2001</year>
          .
          <article-title>Random forests</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Calabrese</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Optimal cut-off for rare events and unbalanced misclassification costs</article-title>
          .
          <source>Journal of Applied Statistics</source>
          <volume>41</volume>
          (
          <issue>8</issue>
          ):
          <fpage>1678</fpage>
          -
          <lpage>1693</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Carvalho</surname>
            ,
            <given-names>D. R.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Freitas</surname>
            ,
            <given-names>A. A.</given-names>
          </string-name>
          <year>2002</year>
          .
          <article-title>A geneticalgorithm for discovering small-disjunct rules in data mining</article-title>
          .
          <source>Applied Soft Computing</source>
          <volume>2</volume>
          (
          <issue>2</issue>
          ):
          <fpage>75</fpage>
          -
          <lpage>88</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Dietterich</surname>
            ,
            <given-names>T. G.</given-names>
          </string-name>
          <year>2000</year>
          .
          <article-title>Ensemble methods in machine learning</article-title>
          .
          <source>In Multiple Classifier Systems</source>
          ,
          <volume>1</volume>
          -
          <fpage>15</fpage>
          . Berlin, Heidelberg: Springer Berlin Heidelberg.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Fawcett</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Provost</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <year>1996</year>
          .
          <article-title>Combining data mining and machine learning for effective user profiling</article-title>
          .
          <source>In Proceedings of the Second International Conference on Knowledge Discovery and Data Mining</source>
          ,
          <fpage>8</fpage>
          -
          <lpage>13</lpage>
          . AAAI Press.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Fawcett</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <year>2006</year>
          .
          <article-title>An introduction to roc analysis</article-title>
          .
          <source>Pattern recognition letters 27</source>
          <volume>(8)</volume>
          :
          <fpage>861</fpage>
          -
          <lpage>874</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Hong</surname>
            ,
            <given-names>C. S.</given-names>
          </string-name>
          <year>2009</year>
          .
          <article-title>Optimal threshold from roc and cap curves</article-title>
          .
          <source>Communications in Statistics - Simulation and Computation</source>
          <volume>38</volume>
          (
          <issue>10</issue>
          ):
          <fpage>2060</fpage>
          -
          <lpage>2072</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Kubat</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Holte</surname>
            ,
            <given-names>R. C.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Matwin</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>1998</year>
          .
          <article-title>Machine learning for the detection of oil spills in satellite radar images</article-title>
          .
          <source>Machine learning 30(2-3)</source>
          :
          <fpage>195</fpage>
          -
          <lpage>215</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Provost</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Fawcett</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <year>2001</year>
          .
          <article-title>Robust classification for imprecise environments</article-title>
          .
          <source>Machine learning 42(3)</source>
          :
          <fpage>203</fpage>
          -
          <lpage>231</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Provost</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <year>2000</year>
          .
          <article-title>Machine learning from imbalanced data sets 101</article-title>
          .
          <source>In Proceedings of the AAAI'2000 workshop on imbalanced data sets</source>
          , volume
          <volume>68</volume>
          ,
          <fpage>1</fpage>
          -
          <lpage>3</lpage>
          . AAAI Press.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Roelens</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Rosier</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ; Dondeyne,
          <string-name>
            <given-names>S.; Van</given-names>
            <surname>Orshoven</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ; and
            <surname>Diels</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <year>2018</year>
          .
          <article-title>Extracting drainage networks and their connectivity using lidar data</article-title>
          .
          <source>Hydrological processes 32</source>
          <volume>(8)</volume>
          :
          <fpage>1026</fpage>
          -
          <lpage>1037</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>G. M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Provost</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <year>2003</year>
          .
          <article-title>Learning when training data are costly: The effect of class distribution on tree induction</article-title>
          .
          <source>Journal of artificial intelligence research</source>
          <volume>19</volume>
          :
          <fpage>315</fpage>
          -
          <lpage>354</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>G. M.</given-names>
          </string-name>
          <year>1999</year>
          .
          <article-title>Timeweaver: A genetic algorithm for identifying predictive patterns in sequences of events.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <source>In Proceedings of the 1st Annual Conference on Genetic and Evolutionary Computation-Volume</source>
          <volume>1</volume>
          ,
          <fpage>718</fpage>
          -
          <lpage>725</lpage>
          . Morgan Kaufmann Publishers Inc.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>G. M.</given-names>
          </string-name>
          <year>2004</year>
          .
          <article-title>Mining with rarity: a unifying framework</article-title>
          .
          <source>ACM Sigkdd Explorations Newsletter</source>
          <volume>6</volume>
          (
          <issue>1</issue>
          ):
          <fpage>7</fpage>
          -
          <lpage>19</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <article-title>Table 2: Continuation of Table 1 Classifier Precision Analytical - Graph - k-nearest neighbors 1 0.6380 k-nearest neighbors 2 0.6476 Analytical 0</article-title>
          .0342 Graph - Naive
          <source>Bayes 1 0.0873 Naive Bayes 2 0.0840 Analytical 0.0342 Graph 0.0000 Linear SVM 1 0.0175 Linear SVM 2 0</source>
          .0870 Analytical
          <string-name>
            <surname>- Graph - Decision Tree</surname>
          </string-name>
          1
          <article-title>- Decision Tree 2 - Analytical 0</article-title>
          .7605 Graph - Random
          <source>Forest 1 0.8652 Random Forest</source>
          <volume>2</volume>
          <fpage>0</fpage>
          .
          <fpage>8641</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>