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.
18 lines
705 B
18 lines
705 B
// Number utilities
|
|
// Converts a value (string, number, etc) to an integer number
|
|
// Assumes radix base 10
|
|
// Returns NaN if the value cannot be converted
|
|
export var toInteger = function toInteger(val) {
|
|
return parseInt(val, 10);
|
|
}; // Converts a value (string, number, etc) to a number
|
|
// Returns NaN if the value cannot be converted
|
|
|
|
export var toFloat = function toFloat(val) {
|
|
return parseFloat(val);
|
|
}; // Converts a value (string, number, etc) to a string
|
|
// representation with 'precision' digits after the decimal
|
|
// Returns the string 'NaN' if the value cannot be converted
|
|
|
|
export var toFixed = function toFixed(val, precision) {
|
|
return toFloat(val).toFixed(toInteger(precision) || 0);
|
|
}; |