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.
25 lines
600 B
25 lines
600 B
'use strict';
|
|
|
|
var utils = require('./utils');
|
|
|
|
/**
|
|
* Map `visit` over an array of objects.
|
|
*
|
|
* @param {Object} `collection` The context in which to invoke `method`
|
|
* @param {String} `method` Name of the method to call on `collection`
|
|
* @param {Object} `arr` Array of objects.
|
|
*/
|
|
|
|
module.exports = function mapVisit(collection, method, arr) {
|
|
if (!Array.isArray(arr)) {
|
|
throw new TypeError('expected an array');
|
|
}
|
|
|
|
arr.forEach(function(val) {
|
|
if (typeof val === 'string') {
|
|
collection[method](val);
|
|
} else {
|
|
utils.visit(collection, method, val);
|
|
}
|
|
});
|
|
};
|
|
|