im-ethz / flirt

Are you ready to FLIRT with your wearable data?
https://flirt.readthedocs.io
Other
61 stars 21 forks source link

fixed EDA feature cvx matrix creation #12

Open hugodecasta opened 7 months ago

hugodecasta commented 7 months ago

Fixing EDA CVX matrix creation

Related to issue #6

The cvx.matrix call can raise a buffer format not supported exception resulting in an empty end DataFrame from feature extraction.

This is due to the y input format being in float32 instead of float64

https://stackoverflow.com/questions/33423081/converting-numpy-vector-to-cvxopt#answers https://github.com/cvxopt/cvxopt/blob/3b718ee560b3b97d6255c55f0ed7f64cb4b72082/src/C/dense.c#L231

Past code

...
n = len(y)
y = cvx.matrix(y)
...

Modifyed code

...
n = len(y)
y = y.astype(np.double)
y = cvx.matrix(y)
...