KevinCoble / AIToolbox

A toolbox of AI modules written in Swift: Graphs/Trees, Support Vector Machines, Neural Networks, PCA, K-Means, Genetic Algorithms
Apache License 2.0
793 stars 87 forks source link

PCA #15

Closed mente371 closed 7 years ago

mente371 commented 7 years ago

i) Your library is great. ii) In the function "getReducedBasisVectorSet(_ data: MLDataSet)", at the end when you create the basisVectors matrice, should it not be basisVectors[(vector initialDimension) + column] = vTranspose[vector + (column initialDimension)] instead of basisVectors[(vector reducedDimension) + column] = vTranspose[vector + (column initialDimension)] ?

KevinCoble commented 7 years ago

i) Thanks! It will be great to see what you do with it.

ii) I think you may be right. I am adding additional code to the XCTest file for PCA to verify the transformDataSet function that uses the basis vectors. I hope to get an update out in a couple of days.

KevinCoble commented 7 years ago

Updated a change today. The new testing hopefully shows it working correctly for multiple basis vectors.

Thanks for finding the issue.