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.
31 lines
674 B
31 lines
674 B
4 years ago
|
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Unique count of anonymous tasks.
|
||
|
* @type {Number}
|
||
|
*/
|
||
|
|
||
|
var anonymousCount = 0;
|
||
|
|
||
|
/**
|
||
|
* Use in a map function to register anonymous functions
|
||
|
* when not registered already.
|
||
|
*
|
||
|
* ```js
|
||
|
* // bind the composer to the mapDeps call
|
||
|
* deps = deps.map(mapDeps.bind(this));
|
||
|
* ```
|
||
|
*
|
||
|
* @param {String|Function} `dep` Dependency name or anonymous function to be registered.
|
||
|
* @return {String} Returns the dependency name
|
||
|
*/
|
||
|
|
||
|
module.exports = function(dep) {
|
||
|
if (typeof dep === 'function') {
|
||
|
var depName = dep.taskName || dep.name || '[anonymous (' + (++anonymousCount) + ')]';
|
||
|
this.task(depName, dep);
|
||
|
return depName;
|
||
|
}
|
||
|
return dep;
|
||
|
};
|