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.
29 lines
782 B
29 lines
782 B
4 years ago
|
'use strict';
|
||
|
|
||
|
var person = require('./person');
|
||
|
var utils = require('../utils');
|
||
|
|
||
|
/**
|
||
|
* Stringify a person object, or array of person objects, such as
|
||
|
* `maintainer`, `collaborator`, `contributor`, and `author`.
|
||
|
*
|
||
|
* @param {Object|Array|String} `val` If an object is passed, it will be converted to a string. If an array of objects is passed, it will be converted to an array of strings.
|
||
|
* @return {String}
|
||
|
* @api public
|
||
|
*/
|
||
|
|
||
|
module.exports = function(persons, key, config, schema) {
|
||
|
if (typeof persons === 'undefined') return;
|
||
|
|
||
|
if (Array.isArray(persons)) {
|
||
|
persons = persons.reduce(function(acc, val) {
|
||
|
var parsed = person(val, key, config, schema);
|
||
|
if (parsed) {
|
||
|
acc.push(parsed);
|
||
|
}
|
||
|
return acc;
|
||
|
}, []);
|
||
|
}
|
||
|
return persons;
|
||
|
};
|