Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
parent
a2e2764987
commit
ae015f2c1a
18
test/test-ml-pca1.js
Normal file
18
test/test-ml-pca1.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
var data = load('test-data-iris.json');
|
||||||
|
|
||||||
|
|
||||||
|
var dataX=ml.preprocess(data,'m',
|
||||||
|
{features:
|
||||||
|
['length','width','petal_length','petal_width']
|
||||||
|
}).data;
|
||||||
|
|
||||||
|
// TODO; update ML from workbook ML-X
|
||||||
|
|
||||||
|
var eigenX=ml.pca.getEigenVectors(dataX);
|
||||||
|
|
||||||
|
var dataZ=ml.pca.computeAdjustedData(dataX,eigenX[0])
|
||||||
|
|
||||||
|
var dataXR=ML.pca.computeOriginalData(
|
||||||
|
dataZ.formattedAdjustedData,
|
||||||
|
dataZ.selectedVectors,
|
||||||
|
dataZ.avgData).formattedOriginalData;
|
Loading…
Reference in New Issue
Block a user