demean_torch

Guide & worked example · Source

demean_torch(x, flist, weights=None, tol=1e-08, maxiter=100000)

Return weighted within residuals and a convergence flag.

Weights must be finite and strictly positive. Each factor is re-encoded, so allocation depends on the number of levels, not the largest label. All columns share one projection pass; the returned array includes the last (converged) update. Computation uses float64, as in the original API.