Calculate the Area Under the ROC Curve (AUC).
971820
def auc(self):
        
        roc_curve = self.roc_curve()
        return np.abs(np.trapz(roc_curve['POD'], x=roc_curve['POFD']))
1056106
def auprc(y_true, y_pred):
    
    y_true, y_pred = _mask_value_nan(y_true, y_pred)
    precision, recall, _ = skm.precision_recall_curve(y_true, y_pred)
    return skm.auc(recall, precision)
419976
def area(self):
        

        self.normalize()
        area = 0.0

        for (order, cells) in self:
            area += (len(cells) * pi) / (3 * 4 ** order)

        return area
591599
function() {
        var area = 0.0;
        for (var i=0, len=this.components.length; i<len; i++) {
            area += this.components[i].getArea();
        }
        return area;
    }
29805
def _get_area(self):
        
        from fontTools.pens.areaPen import AreaPen
        pen = AreaPen(self.layer)
        self.draw(pen)
        return abs(pen.value)
341382
def area(boxes):
    
    x_min, y_min, x_max, y_max = tf.split(boxes, 4, axis=1)
    return tf.squeeze((y_max - y_min) * (x_max - x_min), [1])
851295
def area(self):
        
        area = float(sum(i.area for i in self.polygons_full))
        return area
850474
def compute_radius(wcs):
    """"""

    ra, dec = wcs.wcs.crval
    img_center = SkyCoord(ra=ra * u.degree, dec=dec * u.degree)
    wcs_foot = wcs.calc_footprint()
    img_corners = SkyCoord(ra=wcs_foot[:, 0] * u.degree,
                           dec=wcs_foot[:, 1] * u.degree)
    radius = img_center.separation(img_corners).max().value

    return radius
521852
def size(self):
        '''
        '''
        polygon_area = 0
        for a in self.arcs:
            polygon_area += box_product(a.start_point(), a.end_point())
        polygon_area /= 2.0
        return polygon_area + sum([a.sign * a.segment_area() for a in self.arcs])
725458
def cnst_A0T(self, Y0):
        
        """

        # This calculation involves non-negligible computational cost. It
        # should be possible to disable relevant diagnostic information
        # (dual residual) to avoid this cost.
        Y0f = sl.rfftn(Y0, None, self.cri.axisN)
        if self.cri.Cd == 1:
            return sl.irfftn(np.conj(self.Df) * Y0f, self.cri.Nv,
                             self.cri.axisN)
        else:
            return sl.irfftn(sl.inner(
                np.conj(self.Df), Y0f, axis=self.cri.axisC),
                self.cri.Nv, self.cri.axisN)
589311
def cnst_AT(self, X):
        
        """

        Xf = sl.rfftn(X, axes=self.axes)
        return np.sum(sl.irfftn(np.conj(self.GAf)*Xf, self.axsz,
                                axes=self.axes), axis=self.Y.ndim-1)
1031681
def inROI(self, Y):
        ''''''
        if Y.ndim > 1:
            area = np.zeros((Y.shape[0],4))
        else:
            area = np.zeros((1,4))
        pts = np.zeros((0,), int)
        pdist = np.zeros((0,), int)
        dist0 = 0
        for k in range(len(self.prect)):
            self.square_area = (triangle_area(self.prect[k][0,:], self.prect[k][1,:], self.prect[k][2,:]) +
                            triangle_area(self.prect[k][2,:], self.prect[k][3,:], self.prect[k][4,:]))
            for n in range(4):
                area[:,n] = triangle_area(self.prect[k][0+n,:], self.prect[k][1+n,:], Y)
            # points inside prect
            newpts = np.array((area.sum(axis=1) <= self.square_area+1e-5).nonzero()).flatten().astype(int)
            if newpts.size > 0:
                pts = np.concatenate((pts, newpts))
                newdists = self.orthproj(Y[newpts, :], k) + dist0
                pdist = np.concatenate((pdist, newdists))
            dist0 += (np.diff(self.pos[k], axis=0)[0,:]**2).sum()
            # check if in radius of circle
            if k < len(self.prect)-1:
                pcent = self.pos[k][1,:]
                dist = ((Y - pcent[np.newaxis,:])**2).sum(axis=1)**0.5
                newpts = np.array((dist<=self.d).nonzero()[0].astype(int))
                if newpts.size > 0:
                    pts = np.concatenate((pts, newpts))
                    newdists = dist0 * np.ones(newpts.shape)
                    pdist = np.concatenate((pdist, newdists))

        pts, inds = np.unique(pts, return_index=True)
        pdist = pdist[inds]
        return pts, pdist
141092
function areaUnder(curve, sortx) {
  const sorted = sortx ? curve.sort((a, b) => a.x - b.x) : curve;
  let auc = 0;
  let {x, y} = sorted[0];

  for (let i = 0; i < sorted.length; i++) {
    let e = sorted[i];
    auc += (e.x - x) * (y + (e.y - y) / 2);
    x = e.x;
    y = e.y;
  }
  return auc;
}
923345
def remove_absolute_impute__roc_auc(X, y, model_generator, method_name, num_fcounts=11):
    
    return __run_measure(measures.remove_mask, X, y, model_generator, method_name, 0, num_fcounts, sklearn.metrics.roc_auc_score)
328419
def auprc(y_true, y_pred):
    
    y_true, y_pred = _mask_value_nan(y_true, y_pred)
    return skm.average_precision_score(y_true, y_pred)
405890
def area (self):
    
    area = 0.0
    
    for segment in self.segments():
      area += ((segment.p.x * segment.q.y) - (segment.q.x * segment.p.y))/2

    return area
420891
def _score_micro_average(self, y, y_pred, classes, n_classes):
        
        # Convert y to binarized array for micro and macro scores
        y = label_binarize(y, classes=classes)
        if n_classes == 2:
            y = np.hstack((1-y, y))

        # Compute micro-average
        self.fpr[MICRO], self.tpr[MICRO], _ = roc_curve(y.ravel(), y_pred.ravel())
        self.roc_auc[MICRO] = auc(self.fpr[MICRO], self.tpr[MICRO])