How to use the mad function from mathjs
Find comprehensive JavaScript mathjs.mad code examples handpicked from public code repositorys.
GitHub: jfoclpf/outliers2d
7 8 9 10 11 12 13 14 15 16 17 18
function ellipseMad (points, _sigma) { const sigma = _sigma || 3.5 const medianPoint = [median(points.map(p => p[0])), median(points.map(p => p[1]))] // remove outliers with Median Absolute Deviation (MAD) const madValue = [mad(points.map(p => p[0])), mad(points.map(p => p[1]))] const outliers = [] const filteredPoints = points.filter(pt => { if (
0
3
0
GitHub: bigf00t/bgpeen
27 28 29 30 31 32 33 34 35 36
console.log(stats); const leftHalf = _.filter(exploded, (score) => score <= stats.median); const rightHalf = _.filter(exploded, (score) => score >= stats.median); const leftMad = mad(leftHalf); const rightMad = mad(rightHalf); console.log(leftMad); console.log(rightMad);
0
0
0
+ 3 other calls in file
mathjs.evaluate is the most popular function in mathjs (87200 examples)