@datagrok-libraries/ml
Advanced tools
Comparing version 6.3.53 to 6.3.54
@@ -11,3 +11,3 @@ { | ||
"friendlyName": "Datagrok ML library", | ||
"version": "6.3.53", | ||
"version": "6.3.54", | ||
"description": "Machine learning supporting utilities", | ||
@@ -14,0 +14,0 @@ "dependencies": { |
@@ -8,2 +8,4 @@ import { isNil } from './utils'; | ||
try { | ||
// if (startRow != -1) | ||
// throw new Error('Error in distance matrix worker'); // TODO: remove this line | ||
let i = startRow; | ||
@@ -47,2 +49,2 @@ let j = startCol; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlzdGFuY2UtbWF0cml4LXdvcmtlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImRpc3RhbmNlLW1hdHJpeC13b3JrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLEtBQUssRUFBQyxNQUFNLFNBQVMsQ0FBQztBQUM5QixPQUFPLEVBQUMsT0FBTyxFQUFFLGdCQUFnQixFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDM0QsT0FBTyxRQUFRLE1BQU0seUNBQXlDLENBQUM7QUFFL0QsU0FBUyxHQUFHLENBQUMsS0FBSyxFQUFFLEVBQUU7SUFDcEIsTUFBTSxFQUFDLE1BQU0sRUFBRSxNQUFNLEVBQUUsUUFBUSxFQUFFLFFBQVEsRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFDLEdBQUcsS0FBSyxDQUFDLElBQUksQ0FBQztJQUMxRSxNQUFNLElBQUksR0FBa0YsRUFBRSxDQUFDO0lBQy9GLElBQUk7UUFDRixJQUFJLENBQUMsR0FBRyxRQUFRLENBQUM7UUFDakIsSUFBSSxDQUFDLEdBQUcsUUFBUSxDQUFDO1FBQ2pCLElBQUksR0FBRyxHQUFHLENBQUMsQ0FBQztRQUNaLElBQUksSUFBSSxHQUFHLENBQUMsQ0FBQztRQUNiL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gaWYgKHZhbHVlID4gbG1heClcbiAgICAgICAgbG1heCA9IHZhbHVlO1xuICAgICAgY250Kys7XG4gICAgICBqKys7XG4gICAgICBpZiAoaiA9PT0gdmFsdWVzLmxlbmd0aCkge1xuICAgICAgICBpKys7XG4gICAgICAgIGogPSBpICsgMTtcbiAgICAgIH1cbiAgICB9XG4gICAgZGF0YS5kaXN0YW5jZU1hdHJpeERhdGEgPSByZXRWYWw7XG4gICAgZGF0YS5taW4gPSBsbWluO1xuICAgIGRhdGEubWF4ID0gbG1heDtcbiAgfSBjYXRjaCAoZSkge1xuICAgIGRhdGEuZXJyb3IgPSBlO1xuICB9XG4gIHBvc3RNZXNzYWdlKGRhdGEpO1xufTtcbiJdfQ== |
@@ -6,38 +6,45 @@ import { isNil } from './utils'; | ||
const { values, startIdx, endIdx, sampleLength, fnName, opts } = event.data; | ||
let distances = new Float32Array(sampleLength); | ||
const chunkSize = endIdx - startIdx; | ||
if (isBitArrayMetric(fnName)) { | ||
for (let i = 0; i < values.length; ++i) { | ||
if (isNil(values[i])) | ||
continue; | ||
values[i] = new BitArray(values[i]._data, values[i]._length); | ||
try { | ||
// if (startIdx != -1) | ||
// throw new Error('Error in sparse threshold worker'); // TODO: remove this line | ||
let distances = new Float32Array(sampleLength); | ||
const chunkSize = endIdx - startIdx; | ||
if (isBitArrayMetric(fnName)) { | ||
for (let i = 0; i < values.length; ++i) { | ||
if (isNil(values[i])) | ||
continue; | ||
values[i] = new BitArray(values[i]._data, values[i]._length); | ||
} | ||
} | ||
} | ||
let cnt = 0; | ||
const increment = Math.floor(chunkSize / sampleLength); | ||
const distanceFn = new Measure(fnName).getMeasure(opts); | ||
const startRow = values.length - 2 - Math.floor(Math.sqrt(-8 * startIdx + 4 * values.length * (values.length - 1) - 7) / 2 - 0.5); | ||
const startCol = startIdx - values.length * startRow + Math.floor((startRow + 1) * (startRow + 2) / 2); | ||
let mi = startRow; | ||
let mj = startCol; | ||
let distanceArrayCounter = 0; | ||
while (cnt < chunkSize && distanceArrayCounter < sampleLength) { | ||
//const value = seq1List[mi] && seq1List[mj] ? hamming(seq1List[mi], seq1List[mj]) : 0; | ||
const value = !isNil(values[mi]) && !isNil(values[mj]) ? | ||
distanceFn(values[mi], values[mj]) : 1; | ||
distances[distanceArrayCounter] = value; | ||
distanceArrayCounter++; | ||
// const currentIncrement = Math.floor(Math.random() * increment) + 1 | ||
cnt += increment; | ||
mj += increment; | ||
while (mj >= values.length) { | ||
mi++; | ||
mj = mi + 1 + (mj - values.length); | ||
let cnt = 0; | ||
const increment = Math.floor(chunkSize / sampleLength); | ||
const distanceFn = new Measure(fnName).getMeasure(opts); | ||
const startRow = values.length - 2 - Math.floor(Math.sqrt(-8 * startIdx + 4 * values.length * (values.length - 1) - 7) / 2 - 0.5); | ||
const startCol = startIdx - values.length * startRow + Math.floor((startRow + 1) * (startRow + 2) / 2); | ||
let mi = startRow; | ||
let mj = startCol; | ||
let distanceArrayCounter = 0; | ||
while (cnt < chunkSize && distanceArrayCounter < sampleLength) { | ||
//const value = seq1List[mi] && seq1List[mj] ? hamming(seq1List[mi], seq1List[mj]) : 0; | ||
const value = !isNil(values[mi]) && !isNil(values[mj]) ? | ||
distanceFn(values[mi], values[mj]) : 1; | ||
distances[distanceArrayCounter] = value; | ||
distanceArrayCounter++; | ||
// const currentIncrement = Math.floor(Math.random() * increment) + 1 | ||
cnt += increment; | ||
mj += increment; | ||
while (mj >= values.length) { | ||
mi++; | ||
mj = mi + 1 + (mj - values.length); | ||
} | ||
} | ||
if (distanceArrayCounter < sampleLength) { | ||
distances = distances.slice(0, distanceArrayCounter); | ||
} | ||
postMessage({ distance: distances }); | ||
} | ||
if (distanceArrayCounter < sampleLength) { | ||
distances = distances.slice(0, distanceArrayCounter); | ||
catch (e) { | ||
postMessage({ error: e }); | ||
} | ||
postMessage({ distance: distances }); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhcnNlLW1hdHJpeC10aH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gP1xuICAgICAgICBkaXN0YW5jZUZuKHZhbHVlc1ttaV0sIHZhbHVlc1ttal0pIDogMTtcblxuICAgICAgZGlzdGFuY2VzW2Rpc3RhbmNlQXJyYXlDb3VudGVyXSA9IHZhbHVlO1xuICAgICAgZGlzdGFuY2VBcnJheUNvdW50ZXIrKztcbiAgICAgIC8vIGNvbnN0IGN1cnJlbnRJbmNyZW1lbnQgPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBpbmNyZW1lbnQpICsgMVxuICAgICAgY250Kz1pbmNyZW1lbnQ7XG4gICAgICBtais9aW5jcmVtZW50O1xuICAgICAgd2hpbGUgKG1qID49IHZhbHVlcy5sZW5ndGgpIHtcbiAgICAgICAgbWkrKztcbiAgICAgICAgbWogPSBtaSArIDEgKyAobWogLSB2YWx1ZXMubGVuZ3RoKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoZGlzdGFuY2VBcnJheUNvdW50ZXIgPCBzYW1wbGVMZW5ndGgpIHtcbiAgICAgIGRpc3RhbmNlcyA9IGRpc3RhbmNlcy5zbGljZSgwLCBkaXN0YW5jZUFycmF5Q291bnRlcik7XG4gICAgfVxuICAgIHBvc3RNZXNzYWdlKHtkaXN0YW5jZTogZGlzdGFuY2VzfSk7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICBwb3N0TWVzc2FnZSh7ZXJyb3I6IGV9KTtcbiAgfVxufTsiXX0= |
@@ -6,42 +6,49 @@ import { isNil } from './utils'; | ||
const { values, startIdx, endIdx, threshold, fnName, opts } = event.data; | ||
const i = []; | ||
const j = []; | ||
const distances = []; | ||
const chunkSize = endIdx - startIdx; | ||
//const mi = startRow; | ||
//const mj = startCol; | ||
if (isBitArrayMetric(fnName)) { | ||
for (let i = 0; i < values.length; ++i) { | ||
if (isNil(values[i])) | ||
continue; | ||
values[i] = new BitArray(values[i]._data, values[i]._length); | ||
try { | ||
// if (startIdx != -1) | ||
// throw new Error('Error in sparse matrix worker'); // TODO: remove this line | ||
const i = []; | ||
const j = []; | ||
const distances = []; | ||
const chunkSize = endIdx - startIdx; | ||
//const mi = startRow; | ||
//const mj = startCol; | ||
if (isBitArrayMetric(fnName)) { | ||
for (let i = 0; i < values.length; ++i) { | ||
if (isNil(values[i])) | ||
continue; | ||
values[i] = new BitArray(values[i]._data, values[i]._length); | ||
} | ||
} | ||
} | ||
let cnt = 0; | ||
const distanceFn = new Measure(fnName).getMeasure(opts); | ||
const startRow = values.length - 2 - Math.floor(Math.sqrt(-8 * startIdx + 4 * values.length * (values.length - 1) - 7) / 2 - 0.5); | ||
const startCol = startIdx - values.length * startRow + Math.floor((startRow + 1) * (startRow + 2) / 2); | ||
let mi = startRow; | ||
let mj = startCol; | ||
while (cnt < chunkSize) { | ||
//const value = seq1List[mi] && seq1List[mj] ? hamming(seq1List[mi], seq1List[mj]) : 0; | ||
const value = !isNil(values[mi]) && !isNil(values[mj]) ? | ||
distanceFn(values[mi], values[mj]) : 1; | ||
if (1 - value >= threshold) { | ||
i.push(mi); | ||
j.push(mj); | ||
distances.push(value); | ||
let cnt = 0; | ||
const distanceFn = new Measure(fnName).getMeasure(opts); | ||
const startRow = values.length - 2 - Math.floor(Math.sqrt(-8 * startIdx + 4 * values.length * (values.length - 1) - 7) / 2 - 0.5); | ||
const startCol = startIdx - values.length * startRow + Math.floor((startRow + 1) * (startRow + 2) / 2); | ||
let mi = startRow; | ||
let mj = startCol; | ||
while (cnt < chunkSize) { | ||
//const value = seq1List[mi] && seq1List[mj] ? hamming(seq1List[mi], seq1List[mj]) : 0; | ||
const value = !isNil(values[mi]) && !isNil(values[mj]) ? | ||
distanceFn(values[mi], values[mj]) : 1; | ||
if (1 - value >= threshold) { | ||
i.push(mi); | ||
j.push(mj); | ||
distances.push(value); | ||
} | ||
cnt++; | ||
mj++; | ||
if (mj === values.length) { | ||
mi++; | ||
mj = mi + 1; | ||
} | ||
} | ||
cnt++; | ||
mj++; | ||
if (mj === values.length) { | ||
mi++; | ||
mj = mi + 1; | ||
} | ||
const iArray = new Int32Array(i); | ||
const jArray = new Int32Array(j); | ||
const distanceArray = new Float32Array(distances); | ||
postMessage({ i: iArray, j: jArray, distance: distanceArray }); | ||
} | ||
const iArray = new Int32Array(i); | ||
const jArray = new Int32Array(j); | ||
const distanceArray = new Float32Array(distances); | ||
postMessage({ i: iArray, j: jArray, distance: distanceArray }); | ||
catch (e) { | ||
postMessage({ error: e }); | ||
} | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BhcnNlLW1hdHJpeC13b3JrZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcGFyc2UtbWF0cml4LXdvcmtlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsS0FBSyxFQUFDLE1BQU0sU0FBUyxDQUFDO0FBQzlCLE9BQU8sRUFBZSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUMsTUFBTSxrQkFBa0IsQ0FBQztBQUN6RSxPQUFPLFFBQVEsTUFBTSx5Q0FBeUMsQ0FBQztBQUMvRCxTQUFTLEdBQUcsS0FBSyxFQUFFLEtBQUssRUFBRSxFQUFFO0lBQzFCLE1BQU0sRUFBQyxNQUFNLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLElBQUksRUFBQyxHQUNpRCxLQUFLLENBQUMsSUFBSSxDQUFDO0lBQ3JILE1BQU0sQ0FBQyxHQUFhLEVBQUUsQ0FBQztJQUN2QixNQUFNLENBQUMsR0FBYSxFQUFFLENBQUM7SUFDdkIsTUFBTSxTQUFTLEdBQWEsRUFBRSxDQUFDO0lBQy9CLE1BQU0sU0FBUyxHQUFHLE1BQU0sR0FBRyxRQUFRLENBQUM7SUFDcEMsc0JBQXNCO0lBQ3RCLHNCQUFzQjtJQUV0QixJQUFJLGdCQUFnQixDQUFDLE1BQU0sQ0FBQyxFQUFFO1FBQz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