mathurinm / celer

Fast solver for L1-type problems: Lasso, sparse Logisitic regression, Group Lasso, weighted Lasso, Multitask Lasso, etc.
https://mathurinm.github.io/celer/
BSD 3-Clause "New" or "Revised" License
204 stars 33 forks source link

float32 input not working with celer_path #259

Closed cruyffturn closed 2 years ago

cruyffturn commented 2 years ago

Does celer_path support float32 inputs? I'm using celer v0.6.1 and with the following code receive an error:

from celer import celer_path import numpy as np

X = np.zeros([3,4],np.float32) y = np.zeros(3, np.float32)

celer_path(X,y, 'lasso')

ValueError: Buffer dtype mismatch, expected 'float' but got 'double'

mathurinm commented 2 years ago

Thanks for the feedback. The culprit is a missing dtype specification in the cython code, @Badr-MOUFAD is sending a PR to fix this. When this is merged into main, you'll have to work with the development version (0.7dev) until 0.7 is released to PyPI.

mathurinm commented 2 years ago

@cruyffturn the 0.7dev version from the main branch should support float32 X now. Let us know if you encounter any issue