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.
42 lines
1.1 KiB
42 lines
1.1 KiB
'use strict';
|
|
|
|
var utils = require('../utils');
|
|
var debug = require('../debug');
|
|
|
|
module.exports = function(app) {
|
|
return function(collections, prop, options, schema) {
|
|
if (!collections || utils.isEmpty(collections)) {
|
|
return null;
|
|
}
|
|
|
|
debug.field(prop, collections);
|
|
var views = {};
|
|
var type, msg;
|
|
|
|
if (utils.isObject(collections)) {
|
|
for (var key in collections) {
|
|
var collection = collections[key];
|
|
|
|
if (typeof collection === 'string' || Array.isArray(collection)) {
|
|
var Loader = utils.loader;
|
|
var loader = new Loader(app.options);
|
|
views[key] = loader.load(collection);
|
|
|
|
} else if (utils.isObject(collection)) {
|
|
views[key] = collection;
|
|
|
|
} else {
|
|
type = utils.typeOf(collection);
|
|
msg = 'expected views to be an object, string or array, received: "' + type + '"';
|
|
throw new TypeError(msg);
|
|
}
|
|
}
|
|
} else {
|
|
type = utils.typeOf(collections);
|
|
msg = 'expected collections to be an object, received: "' + type + '"';
|
|
throw new TypeError(msg);
|
|
}
|
|
|
|
return views;
|
|
};
|
|
};
|
|
|