-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Usage:
const pca = new PCA([vector]);
const result = pca.predict([vector], { nComponents: 2 });...where vector is an array with 1,536 elements a la an Open AI embedding. E.g. const vector = [0.00728, -0.0181, 0.014, ....]
The goal is to reduce/project the 1,536-element vector into 2d space for graphing related vectors.
However, when I call pca.predict, it throws this error:
(PID 60093) 2023-07-03T22:51:51.304Z [ERROR] script-cli.js:127: RangeError: Submatrix indices are out of range
at checkRange (/Users/josiahbryan/devel/rubber/backend/node_modules/ml-matrix/matrix.js:1038:11)
at Matrix.subMatrix (/Users/josiahbryan/devel/rubber/backend/node_modules/ml-matrix/matrix.js:2455:5)
at PCA.predict (/Users/josiahbryan/devel/rubber/backend/node_modules/ml-pca/lib/pca.js:123:28)
[snipped]MellKam
Metadata
Metadata
Assignees
Labels
No labels