def scale_row_go

mlbend-preprocess@0.1.0.0 · main.bend:192

import mlbend-preprocess@0.1.0.0/main.bend as MlbendPreprocess
import Base

192# One row scaled column by column, cell by cell.
193def scale_row_go(+row: List<&2, F32>, mins: List<&2, F32>, maxs: List<&2, F32>,
194  +acc: List<&2, F32>) -> List<&2, F32>:
195  match row:
196    case Nil{}:
197      acc
198    case Con{h, t}:
199      match mins:
200        case Nil{}:
201          acc
202        case Con{+m, ms}:
203          match maxs:
204            case Nil{}:
205              acc
206            case Con{mx, mxs}:
207              scale_row_go(t, ms, mxs,
208                List.append(&2, F32, acc,
209                  Con{((h - m : F32) / F32.max((mx - m : F32), 0.00000001) : F32), Nil{}}))

Uses (6)

Used by (1)