แก้ coding style ภาค 3
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {takeSampleFrom} from "./helpers";
|
||||
import {placeNearToNearestNeighbour} from "./interpCommon";
|
||||
import {takeSampleFrom} from './helpers';
|
||||
import {placeNearToNearestNeighbour} from './interpCommon';
|
||||
|
||||
/**
|
||||
* Perform interpolation where the "parent" node is found by brute-force.
|
||||
@@ -18,19 +18,19 @@ import {placeNearToNearestNeighbour} from "./interpCommon";
|
||||
* @param {number} endingIts - for phase 3, how many iterations to refine the
|
||||
* placement of each interpolated point
|
||||
*/
|
||||
export default function(sampleSet, remainderSet, distanceFn, endingIts) {
|
||||
export default function (sampleSet, remainderSet, distanceFn, endingIts) {
|
||||
let
|
||||
sampleSubset = takeSampleFrom(sampleSet, Math.sqrt(sampleSet.length)).sample,
|
||||
sampleSubsetDistanceCache = [];
|
||||
|
||||
// For each datapoint "node" to be interpolated
|
||||
for (let i = remainderSet.length-1; i>=0; i--) {
|
||||
for (let i = remainderSet.length - 1; i >= 0; i--) {
|
||||
let
|
||||
node = remainderSet[i],
|
||||
nearestSample, minDist, sample, dist, index;
|
||||
|
||||
// For each datapoint "sample" in the sample set
|
||||
for (let j = sampleSet.length-1; j>=0; j--) {
|
||||
for (let j = sampleSet.length - 1; j >= 0; j--) {
|
||||
sample = sampleSet[j];
|
||||
dist = distanceFn(node, sample);
|
||||
if (nearestSample === undefined || dist < minDist) {
|
||||
|
||||
Reference in New Issue
Block a user