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.
|
5 years ago | |
---|---|---|
.. | ||
test | 5 years ago | |
.npmignore | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
package.json | 5 years ago | |
search-bounds.js | 5 years ago |
README.md
binary-search-bounds
Binary search on arrays. Also works if the inputs are 1D ndarrays.
Install
npm install binary-search-bounds
API
var bounds = require("binary-search-bounds")
bounds.lt(array, y[, cmp, lo, hi])
Returns the index of the last item in the array <
y
bounds.le(array, y[, cmp, lo, hi])
Returns the index of the last item in the array <=
y
bounds.gt(array, y[, cmp, lo, hi])
Returns the index of the first item in the array >
y
bounds.ge(array, y[, cmp, lo, hi])
Returns the index of the first item in the array >=
y
bounds.eq(array, y[, cmp, lo, hi])
Returns an index of some item in the array == y
.
Notes
The following comments apply to the above methods:
array
can be either an array or anndarray
cmp
is a comparison function, just like what you would pass toArray.sort()
y
will always be the second argument passed tocmp
, so you can ignore it if you are just binary searching on a predicate.- Assumes the array is sorted as would be the case if you called
Array.sort(cmp)
on it - If no comparison is passed, assume array is sorted in ascending order (note this is different than the semantics of Array.sort() which converts all entries to strings if you don't pass an argument)
lo
gives a lower bound on the array index to search. If not specified defaults to 0.hi
gives an upper bound on the array index to search. If not specified defaults toarray.length-1
- Bouth bounds are inclusive.
bounds.le
andbounds.lt
will returnlo - 1
if no element is found that==y
bounds.ge
andbounds.gt
will returnhi + 1
if no element is found that==y
bounds.eq
will return-1
if no element matchingy
is found.bounds.eq
will return the first found item with the given index. It can be a little faster than the other methods if you just want to find some random match and do not care where it is.
Credits
(c) 2013 Mikola Lysenko. MIT License