glum icon indicating copy to clipboard operation
glum copied to clipboard

Force dtype `np.float64` for optimization while data dtype is `np.float32`

Open mlondschien opened this issue 1 year ago • 1 comments

We're having quite a few problems with optimization in float32. In small batches, these go away if we .astype(np.float64) our data before calling glum.GeneralizedLinearRegressor.fit. This also makes the algorithm much faster for some reason. However, we cannot afford the float32 -> float64 conversion on the entire dataset due to memory constraints.

Is there an option to do the optimization in glum (i.e., probably, coef and the current hessian estimate) in float64 even if the data itself is float32?

mlondschien avatar Sep 20 '24 06:09 mlondschien