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.
16 lines
482 B
16 lines
482 B
var padLeft = require('pad-left')
|
|
|
|
module.exports = addLineNumbers
|
|
function addLineNumbers (string, start, delim) {
|
|
start = typeof start === 'number' ? start : 1
|
|
delim = delim || ': '
|
|
|
|
var lines = string.split(/\r?\n/)
|
|
var totalDigits = String(lines.length + start - 1).length
|
|
return lines.map(function (line, i) {
|
|
var c = i + start
|
|
var digits = String(c).length
|
|
var prefix = padLeft(c, totalDigits - digits)
|
|
return prefix + delim + line
|
|
}).join('\n')
|
|
}
|
|
|