lightonOPU and lightonML libraries upgraded to v1.2

lightonOPU and lightonML libraries have been updated to v1.2.
Read the detailed release notes and the migration guide.

Version 1.2

Release notes

New features

  • Online transform mode allows a large speedup when running transform on single vectors, or small batches (<100 vectors). To use it, add online=True to the new OPU fit1d/fit2d methods. On single vectors the speedup is more than 70x with regards to online=False .
  • Add fit/transform methods. The new fit1d / fit2d methods allow the OPU transform to be fit first before transform. They accept in parameters either the number of features, or input vectors.
  • The transform method is called without 1d/2d variants, the choice for number of input dimensions going to the fit1d / fit2d methods.
  • Add a fit to OPUMap objects in lightonml.projections.sklearn and lightonml.projections.torch .

Minor changes

  • Context metadata with information on the transform is now an attribute of the output array
  • Internal optimizations speed up transform by ~5 %
  • Add new verbose level (0 to 3, 3 being the most verbose), and set it at a global level with lightonopu.set_verbose_level()
  • Allow transform settings to be overridden in the fit1d/fit2d methods (for advanced usage)

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 an 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:

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.