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.
36 lines
880 B
36 lines
880 B
4 years ago
|
'use strict';
|
||
|
|
||
|
var utils = require('../utils/');
|
||
|
|
||
|
/**
|
||
|
* Choice object
|
||
|
* Normalize input as choice object
|
||
|
* @param {String|Object} `val` Choice value. If an object is passed, it should contain at least one of `value` or `name` property.
|
||
|
* @api public
|
||
|
*/
|
||
|
|
||
|
var Choice = module.exports = function(val, answers) {
|
||
|
// Don't process Choice and Separator object
|
||
|
if (val instanceof Choice || val.type === 'separator') {
|
||
|
return val;
|
||
|
}
|
||
|
|
||
|
if (typeof val === 'string') {
|
||
|
this.name = val;
|
||
|
this.value = val;
|
||
|
this.short = val;
|
||
|
} else {
|
||
|
utils.extend(this, val, {
|
||
|
name: val.name || val.value,
|
||
|
value: val.hasOwnProperty('value') ? val.value : val.name,
|
||
|
short: val.short || val.name || val.value
|
||
|
});
|
||
|
}
|
||
|
|
||
|
if (typeof val.disabled === 'function') {
|
||
|
this.disabled = val.disabled(answers);
|
||
|
} else {
|
||
|
this.disabled = val.disabled;
|
||
|
}
|
||
|
};
|