diff --git a/modules/manifold/src/actions/io-actions.js b/modules/manifold/src/actions/io-actions.js index 2b53f88..f432e75 100644 --- a/modules/manifold/src/actions/io-actions.js +++ b/modules/manifold/src/actions/io-actions.js @@ -58,7 +58,7 @@ export const loadLocalData = ({ // 3. validate data .then(validateInputData) // 4. get metadata from input data, also convert csv data to array of arrays instead of array of objects - // TODO: this change should happen in `parsePromse`. But that will break API of `dataTransformer` so push it later + // TODO: this change should happen in `parsePromise`. But that will break API of `dataTransformer` so push it later .then(computeMetaData) // 5. add data to redux state .then(result => { diff --git a/modules/manifold/src/selectors/compute.js b/modules/manifold/src/selectors/compute.js index 984dd13..3cb87b7 100644 --- a/modules/manifold/src/selectors/compute.js +++ b/modules/manifold/src/selectors/compute.js @@ -141,7 +141,7 @@ export const getDataIdsInSegmentsUnsorted = createSelector( } else { assert( nClusters !== null && !isNaN(nClusters), - 'must provide `nClusters for automatic segmentation' + 'must provide `nClusters` for automatic segmentation' ); return computeAutoSegmentationResult(data, columnTypeRanges, nClusters); } diff --git a/modules/manifold/src/utils/kepler-utils.js b/modules/manifold/src/utils/kepler-utils.js index 444c397..e774e5b 100644 --- a/modules/manifold/src/utils/kepler-utils.js +++ b/modules/manifold/src/utils/kepler-utils.js @@ -82,7 +82,7 @@ export function getKeplerLayers( ) { // iterate each feature const layersInfoNested = geoFeatures.map((geoFeatureDef, geoFeatureId) => { - // no need to create 2 layers if this is an agregated layer + // no need to create 2 layers if this is an aggregated layer if (!geoFeatureDef.pair) { return { geoFeatureDef, diff --git a/modules/mlvis-common/src/utils/kmeans.js b/modules/mlvis-common/src/utils/kmeans.js index a9d4ead..58ca1d0 100644 --- a/modules/mlvis-common/src/utils/kmeans.js +++ b/modules/mlvis-common/src/utils/kmeans.js @@ -55,7 +55,7 @@ export function initCentroids(X, nClusters) { * @param {Tensor2D} samples - data points being clustered, shape = [nInstances, nDims] * @param {Tensor2D} centroids - positions of cluster centers, shape = [nClusters, nDims] * @param {Boolean} fillEmpty - whether to enforce all clusters to be non-empty - * @returns {Tensor1D} indices of the nearest centroid to each data instance, shape = [nInscances] + * @returns {Tensor1D} indices of the nearest centroid to each data instance, shape = [nInstances] */ export function assignClusterId(samples, centroids, fillEmpty = true) { return tf.tidy(() => { @@ -78,10 +78,10 @@ export function assignClusterId(samples, centroids, fillEmpty = true) { * check whether nearest include all possible cluster Ids * (i.e.all clusters have non - zero number of instances) * if not, assign the one with farthest distance from center to the missing cluster - * @param {Tensor2D} distances - distances between data instances and centroids, shape = [nClusters, nInscances] + * @param {Tensor2D} distances - distances between data instances and centroids, shape = [nClusters, nInstances] * @param {Number} minCount - minimum number of instances in a cluster * @returns {Tensor1D} indices of the nearest centroid to each data instance - * (after empty clusters are filled), shape = [nInscances] + * (after empty clusters are filled), shape = [nInstances] * e.g. consider clustering a dataset with 4 data points into 3 clusters: * ``` * distances = [ @@ -97,12 +97,12 @@ export function assignClusterId(samples, centroids, fillEmpty = true) { * ``` * However we need to ensure cluster_1 and cluster_2 also have at least 1 data instance in them. * First for cluster_1, we mutate the cluster assignment of instance_0 from `0` to `1`, - * because distnace between instances_0 and centroid_1 is `5`, smallest among all data instances: + * because distance between instances_0 and centroid_1 is `5`, smallest among all data instances: * ``` * mins = [1, 0, 0, 0] * ``` * Then for cluster_2, we mutate the cluster assignment of instance_1 from `0` to `2`, - * because distnace between instances_1 and centroid_2 is `10`, smallest among + * because distance between instances_1 and centroid_2 is `10`, smallest among * all data instances except for instances_0 (which has already been mutated in previous round): * ``` * mins = [1, 2, 0, 0] @@ -111,7 +111,7 @@ export function assignClusterId(samples, centroids, fillEmpty = true) { export function fillEmptyClusters(distances, minCount = 1) { return tf.tidy(() => { const nClusters = distances.shape[0]; - // mins: the IDs of centroid that's nearest to each data instance, shape = [nInscances] + // mins: the IDs of centroid that's nearest to each data instance, shape = [nInstances] let mins = tf.argMin(distances, 0).toInt(); let mutatedIds = tf.tensor([]); let count = 0;