@elarsaks/umap-wasm 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +349 -0
- package/dist/src/heap.d.ts +12 -0
- package/dist/src/heap.js +226 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/lib.d.ts +1 -0
- package/dist/src/lib.js +5 -0
- package/dist/src/matrix.d.ts +41 -0
- package/dist/src/matrix.js +360 -0
- package/dist/src/nn_descent.d.ts +17 -0
- package/dist/src/nn_descent.js +204 -0
- package/dist/src/tree.d.ts +16 -0
- package/dist/src/tree.js +320 -0
- package/dist/src/umap.d.ts +102 -0
- package/dist/src/umap.js +842 -0
- package/dist/src/utils.d.ts +16 -0
- package/dist/src/utils.js +137 -0
- package/dist/src/wasmBridge.d.ts +57 -0
- package/dist/src/wasmBridge.js +290 -0
- package/dist/test/matrix.test.d.ts +1 -0
- package/dist/test/matrix.test.js +169 -0
- package/dist/test/nn_descent.test.d.ts +1 -0
- package/dist/test/nn_descent.test.js +58 -0
- package/dist/test/test_data.d.ts +13 -0
- package/dist/test/test_data.js +1054 -0
- package/dist/test/tree.test.d.ts +1 -0
- package/dist/test/tree.test.js +60 -0
- package/dist/test/umap.test.d.ts +1 -0
- package/dist/test/umap.test.js +293 -0
- package/dist/test/utils.test.d.ts +1 -0
- package/dist/test/utils.test.js +128 -0
- package/dist/test/wasmDistance.test.d.ts +1 -0
- package/dist/test/wasmDistance.test.js +124 -0
- package/dist/test/wasmMatrix.test.d.ts +1 -0
- package/dist/test/wasmMatrix.test.js +389 -0
- package/dist/test/wasmTree.test.d.ts +1 -0
- package/dist/test/wasmTree.test.js +212 -0
- package/lib/umap-js.js +8657 -0
- package/lib/umap-js.min.js +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var nnDescent = __importStar(require("../src/nn_descent"));
|
|
40
|
+
var umap_1 = require("../src/umap");
|
|
41
|
+
var prando_1 = __importDefault(require("prando"));
|
|
42
|
+
describe('umap nnDescent methods', function () {
|
|
43
|
+
var prando = new prando_1.default(42);
|
|
44
|
+
var random = function () { return prando.next(); };
|
|
45
|
+
test('returns a nearest neighbors function', function () {
|
|
46
|
+
var nnDescentFn = nnDescent.makeNNDescent(umap_1.euclidean, random);
|
|
47
|
+
expect(nnDescentFn instanceof Function).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
test('returns an initialized nearest neighbors search function', function () {
|
|
50
|
+
var nnSearchFn = nnDescent.makeInitializedNNSearch(umap_1.euclidean);
|
|
51
|
+
expect(nnSearchFn instanceof Function).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
test('returns initialization functions', function () {
|
|
54
|
+
var _a = nnDescent.makeInitializations(umap_1.euclidean), initFromRandom = _a.initFromRandom, initFromTree = _a.initFromTree;
|
|
55
|
+
expect(initFromRandom instanceof Function).toBe(true);
|
|
56
|
+
expect(initFromTree instanceof Function).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const testData: number[][];
|
|
2
|
+
export declare const additionalData: number[][];
|
|
3
|
+
export declare const transformResult2d: number[];
|
|
4
|
+
export declare const testLabels: number[];
|
|
5
|
+
export declare const additionalLabels: number[];
|
|
6
|
+
export declare const testResults2D: number[][];
|
|
7
|
+
export declare const testResults3D: number[][];
|
|
8
|
+
export declare const treeData: {
|
|
9
|
+
hyperplanes: number[][];
|
|
10
|
+
offsets: number[];
|
|
11
|
+
children: number[][];
|
|
12
|
+
indices: number[][];
|
|
13
|
+
};
|