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.
81 lines
1.7 KiB
81 lines
1.7 KiB
// (c) Copyright 2016, Sean Connelly (@voidqk), http://syntheti.cc
|
|
// MIT License
|
|
// Project Home: https://github.com/voidqk/polybooljs
|
|
|
|
//
|
|
// simple linked list implementation that allows you to traverse down nodes and save positions
|
|
//
|
|
|
|
var LinkedList = {
|
|
create: function(){
|
|
var my = {
|
|
root: { root: true, next: null },
|
|
exists: function(node){
|
|
if (node === null || node === my.root)
|
|
return false;
|
|
return true;
|
|
},
|
|
isEmpty: function(){
|
|
return my.root.next === null;
|
|
},
|
|
getHead: function(){
|
|
return my.root.next;
|
|
},
|
|
insertBefore: function(node, check){
|
|
var last = my.root;
|
|
var here = my.root.next;
|
|
while (here !== null){
|
|
if (check(here)){
|
|
node.prev = here.prev;
|
|
node.next = here;
|
|
here.prev.next = node;
|
|
here.prev = node;
|
|
return;
|
|
}
|
|
last = here;
|
|
here = here.next;
|
|
}
|
|
last.next = node;
|
|
node.prev = last;
|
|
node.next = null;
|
|
},
|
|
findTransition: function(check){
|
|
var prev = my.root;
|
|
var here = my.root.next;
|
|
while (here !== null){
|
|
if (check(here))
|
|
break;
|
|
prev = here;
|
|
here = here.next;
|
|
}
|
|
return {
|
|
before: prev === my.root ? null : prev,
|
|
after: here,
|
|
insert: function(node){
|
|
node.prev = prev;
|
|
node.next = here;
|
|
prev.next = node;
|
|
if (here !== null)
|
|
here.prev = node;
|
|
return node;
|
|
}
|
|
};
|
|
}
|
|
};
|
|
return my;
|
|
},
|
|
node: function(data){
|
|
data.prev = null;
|
|
data.next = null;
|
|
data.remove = function(){
|
|
data.prev.next = data.next;
|
|
if (data.next)
|
|
data.next.prev = data.prev;
|
|
data.prev = null;
|
|
data.next = null;
|
|
};
|
|
return data;
|
|
}
|
|
};
|
|
|
|
module.exports = LinkedList;
|
|
|