Removing outliers while creating classifiers

It’s in the sp.classcreate object in the p writeDictp info subpatch.

The summary outlined in the interpolation thread is this:

  • unpacked fluid.dataset~ / fluid.labelset~ to dicts
  • dict.unpack data: just to get the data bits
  • push_to_coll to move into coll-land
  • use the label coll to fork the MFCC coll into a separate coll per class
  • pull_from_coll back into dict-land and load into fluid.dataset~s (one per class)
  • tobuffer the fluid.dataset~s to get them into buffer~s
  • fluid.bufstats~ to get the means per column (now channels)
  • fluid.buf2list @axis 1 to get the mean of each class

The code itself is this:


----------begin_max5_patcher----------
7304.3oc6cs0iqiaj94d9UHz6qcT38KmmlryhMurA6CI.KVDDzPss5t0LxWV
eYNWBR9suEIkjkrojoror6YxzGb51VR1j0GqpXUEKV7u+cO73Kq9R91GS9Tx
eM4gG96e2COXuj4BOT89GdbQ1WlUls09XOtL+yqd4Ge7I2s1k+kc1KuI4eCM
qLOaS8cJlauN7r+NBs9hK2unXYY9N6WE5vEWseW8UwUWcc1tYuWr7sm2jOam
qChI7TzSIDLOkRobElp4TlRgvOkHz1aQRQI+spuA2W5tutN28we7wj+l4N+i
u66L+5ooifwx3PvLJ1PUXjHURwFRkJIHMQQ9nQv7XMBSnFxRvzoRFgiwBhTi
DJo9iFEGIdZAh4FhwXfh0NFZpDSk76.EOaUYogng+777rcYdHbsW5F6ktY8S
2DBJEwvh5ejXFPobbJ..TBuR3FoLPCO.T3oV+u4w1l8y4yeF50Py9b1tcaJd
Y+Nm5tGZ.lGdLewK4yaM5AcXniVrsX0RyUE1KZA3I.lKydIubqGfVFGflpjV
FLFIUSAkGTDwfuRkAZwzesAseqLYS9adfSpe7j3EOICw3xREs9ATS8TBSn.M
zJipJsDtDCQeBP9.A2XJAuNY1pEqgghev7j+o7rka8NAEZDnwPJrwjtngQLl
C5zzzZUYDrUJ1MU1vnw7hY6.NirMe8.ilsQy2bLi0qEk4+b9lZFIbM6U150s
t7Cs9HF76GWY+hTO0bohktKIZtzl7etg+j0b0rM.ouCn68ar81G+hf83gulU
yy2rb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6LlsZyXJbZTJtIY54l.GZ1pw9u20BZhfRTigMotxrYkIgNasA2LkPapK
s0G3VFisauEw5XEd6ab0TpHHJMFqfqqsvAkTb8FWMF1luyJDOE0B5jl3QIb6
aPO26p64rfRbmnnuiqCZd0AMIPvIt0gUkxNdq3TgfdtWT54mWsFOZnDNn1hb
0skJXsAWMmFOHYDtNJXn3FNdETBwxUQACCJdin3zViYUZ6YAMIzFoUJibH63
Qr9VaIOOZrCwXXTF4xorlbEI.R4JsBgNlUqsGMpthVDz6f4e4nZ8lLEwte0k
V2X7c26BwzDOnwQLhF+EO8VCye41rAYqWaNLip5KVR3wEY+n6TmP8j8sEKcu
UXe6l7etYuIZ2RkOlsYl4zGZ1t8abGlCeoZCn+3hUPCubeQEFZOWIdztuMrG
oBqyb3jc6c7c+iu6+G.0IE5M
-----------end_max5_patcher-----------

I’m certain there’s more efficient ways to do that by not going into coll for the heavy lifting and just doing whatever is needed in dicts, but for me the most confusing/challenging bit was breaking up a fluid.dataset~ into separate chunks based on a fluid.labelset~.

It’s kind of a data uncanny valley/blindspot in the fluid.verse where the fluid.dataset~ is a monolithic thing, but when working with classes (or lots of other use cases), there are subsections of it that carry significance and would be handy to break apart.

Hell, just being able to use a labelset in the context of fluid.datasetquery~ would help a ton, even with hose tricky to parse that object/syntax is. Beats dumping/iterating endlessly!

Absolutely! Could fit into the ecosystem quite nicely.