gnu-octave / statistics

The Statistics package for GNU Octave
GNU General Public License v3.0
25 stars 23 forks source link

Release 1.5.4: PCA crashes with a single output when the number of components is specified #97

Closed tiborauer closed 1 year ago

tiborauer commented 1 year ago

The error occurs when the condition in https://github.com/gnu-octave/statistics/blob/8a8e723c32b6d9a87f2da993284c97159ef6061d/inst/pca.m#L367 is not met but the condition in https://github.com/gnu-octave/statistics/blob/8a8e723c32b6d9a87f2da993284c97159ef6061d/inst/pca.m#L449 is.

pr0m1th3as commented 1 year ago

Could you provide an example?

tiborauer commented 1 year ago

This one crashes: comp = pca(rand(10,100),'NumComponents',2) This one does not: [comp score] = pca(rand(10,100),'NumComponents',2);

pr0m1th3as commented 1 year ago

Just pushed a commit that fixes this error!

tiborauer commented 1 year ago

Thank you! Would you also update the Octave package?

pr0m1th3as commented 1 year ago

There will be a new release sometime in the next two weeks. If you want to use the latest functionality with the changes in the pca fuction, you can install from dev with the following command from the octave terminal

pkg install "https://github.com/gnu-octave/statistics/archive/refs/heads/main.zip"