Closed anniepank closed 1 year ago
Would you be able to elaborate on the problem? Why do you need to call transform for multiple times? How would the test data converge to each item in the test set?
So the problem was the following: I first have trained a pacmap transformation on my training data x
fit = pacmap.PaCMAP()
transformed = fit.fit_transform(x, init='pca')
and then I wanted to project the new datasets x2, x3 and so on onto the learned embedding space with:
x2_transformed = fit.transform(x2, basis=x, init='pca')
however transform method changes the basis argument x during the call and therefore for the next calls like fit.transform(x3, basis=x, init='pca')
the result becomes invalid, since x is not the same anymore. I have solved it by sending the copy of my basis x into the transform method like fit.transform(x3, basis=x.copy(), init='pca')
Thank you for reporting the undesired behavior! We will fix this problem soon.
This problem should have been fixed in the previous release of 0.7.0, so I'm closing this issue.
Try out calling .transform() after the fitting the dataset several times on the test set, the results will start converging to the same value for each item in the test batch.