# Migration Guide¶

Version 1.2 of lightonopu and lightonml introduce API changes, requiring action on your code:

## lightonopu¶

We noticed that in some situations, two successive transforms on related data can have inconsistent result, fitting the OPU on input data fixes this. The previous methods transform1d and transform2d are still provided for compatibility, but you will get a deprecation warning on calling them. To migrate your code, do the following:

• If you do several transform operations on related data (like train and test), first call fit1d or fit2d on one of the data, and then transform (notice the 1d/2d suffix is removed)

• Alternatively, replace transform1d/transform2d calls by fit_transform1d/fit_transform2d to get rid of the deprecation warning.

## lightonml¶

Similarly to lightonopu, the OPUMap objects in lightonml.projections.sklearn and lightonml.projections.torch now also have a fit method. It can be called explicitly, or it will be called automatically when the first transform is performed. The migration procedure is similar: - If you do several transform operations on related data (like train and test), first call fit on one of the data, and then transform, or forward in the case of the Pytorch wrapper - Alternatively, replace transform calls by fit_transform for the Scikit-learn wrapper.