StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
548 B
24 lines
548 B
"use strict"
|
|
|
|
var abs = Math.abs
|
|
, min = Math.min
|
|
|
|
function almostEqual(a, b, absoluteError, relativeError) {
|
|
var d = abs(a - b)
|
|
|
|
if (absoluteError == null) absoluteError = almostEqual.DBL_EPSILON;
|
|
if (relativeError == null) relativeError = absoluteError;
|
|
|
|
if(d <= absoluteError) {
|
|
return true
|
|
}
|
|
if(d <= relativeError * min(abs(a), abs(b))) {
|
|
return true
|
|
}
|
|
return a === b
|
|
}
|
|
|
|
almostEqual.FLT_EPSILON = 1.19209290e-7
|
|
almostEqual.DBL_EPSILON = 2.2204460492503131e-16
|
|
|
|
module.exports = almostEqual
|
|
|