From 15687953005f8c10fc69f9be35f3439d04ddcde2 Mon Sep 17 00:00:00 2001 From: Anton Nesterov Date: Thu, 26 Sep 2024 06:07:37 +0200 Subject: [PATCH] fillzero --- expr.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/expr.ts b/expr.ts index 29ef2f0..498b1dc 100644 --- a/expr.ts +++ b/expr.ts @@ -8,6 +8,10 @@ export function residuals(x: pl.Expr, y: pl.Expr): pl.Expr { return yM.minus(beta.mul(xM)); } +export const fillzero = ( + value = 0.0001, +) => (pl.all().replaceStrict(0, value, pl.all())); + export const ScaleExpr: pl.Expr = (pl.all().minus(pl.all().min())).div( pl.all().max().minus(pl.all().min()), );