Skip to content

Feature/matrix wide scaling - #351

Draft
tremblap wants to merge 2 commits into
flucoma:mainfrom
tremblap:feature/matrix-wide-scaling
Draft

tremblap wants to merge 2 commits into
flucoma:mainfrom
tremblap:feature/matrix-wide-scaling

Conversation

@tremblap

Copy link
Copy Markdown
Member

Mostly for 2D drawing, we need matrix-wide, not column-wise, data processing to preserve the original shape and the relevance of diagonal distances. This is done for the 3 transformers.

At the moment, there are 3 questions for @weefuzzy @jamesb93 and @tedmoore :

  1. It currently works as an overide of the original code (to test the algo, and review my implementation idea of keeping the processors intact post fitting (so still processing by vectors) - I think it is a good idea, but someone might disagree.
  2. at the moment, the idea is to have a flag to process colwise (as before, and would be the default) or matrixwise. this implies a forking only in the algo, and I could code it, except if I'm told we should do a 'fit-full-dataset' method instead. both are trivial to implement and I'll do it in the next push on this PR if this is the agreed way
  3. if this is the agreed way, the isDSwide name is appalling. Even just dswide is appalling. but I am struggling to find something for now that stays in the vocabulary (byDim, byDS, byCol, colwise, keepshape, relative) so please let's brainstorm. obviously the default will be the backward-compatible switch

Thanks!

@tremblap
tremblap marked this pull request as draft October 27, 2026 13:41
@tremblap

Copy link
Copy Markdown
Member Author

example code in SC to see it work and test the dims are right (3x2 is perfect for debugging :) )

d = FluidDataSet(s).load(Dictionary.newFrom([\cols, 2, \data, Dictionary.newFrom([\p1, [0.1, 0.2], \p2, [0.3, 0.9], \p3, [0.2, 0.5]])]))
d.print

~fp = FluidPlotter(bounds:Rect(200,200,600,600), xmin: -0.1, xmax: 1.1, ymin: -0.1, ymax: 1.1)

d.dump{|x|defer{~fp.dict = x}}

n = FluidNormalize(s)

n.fitTransform(d,d)

r = FluidRobustScale(s)

r.fitTransform(d,d)

w = FluidStandardize(s)

w.fitTransform(d,d)

~fp.xmin_(-3).ymin_(-3).xmax_(3).ymax_(3)

@tedmoore

Copy link
Copy Markdown
Member

My first thought for the arg name was "by column" (or byCol or whatever is appropriate), which was also one of your suggestions, so there's some resonance there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants