New Object Early Community Build #3 and 4-5-6: FluidDataSeries, and DTW-based classification and regression - NOW IN SC TOO

OK this one is a big one - actually a new concept, FluidDataSeries, which would be a dataset of time series, and 2 first ways of dealing with them, mostly finding distances (DTW) and therefore being able to find nearest neighbour, and therefore being able to find classes and interpolated values.

Now, please follow the (very ugly and terse and verbose and messy) tutorials in order to understand them. At the moment, it is brute-forcing so it won’t work well with huge data series either. It is very early release so we can see where that can go in the next months. Not the next release :slight_smile:

I don’t need to be told the patches are ugly :smiley: But if you stall despite reading the text and following the numbers, that, I need to know, so I can try to devise some sort of learning material. or if you find an interface discrepancy vs your usual fluid-coding-style.

update:
Max only, MacOS fat and PC thought. SC should be soon in, probably next week or earlier if I have insomnia on the plane
SC is now available too, see below.

p

original download link redacted-see below for an updated version

2 Likes

This seems very cool!

I can see the distance querying being very useful in a lot of my use cases since the contour/gesture is often the most relevant bit, rather than the specific descriptors.

For the classifier/regressor bits, I tried messing with it a bit but couldn’t exactly make sense of the logic/routing, but is it possible to classify/regress as you go? As in, while drawing a shape, have constant output, potentially with some kind of confidence/distance metric?

I found myself wanting to see the regressor wiggle around as I drew the input, rather than waiting for me to finish (handwriting detection style).

Obviously a better comparison(/classification/regression) can be made once the whole time series is complete, but it can match portions of a gesture as it goes?

re legibility:
As is my way of understanding things, I found patches 2/3 way more indicative of what was happening vs patch1. Particularly all the bits having steps 1/2/3/4/5/6 being loops and all over the screen, with some steps having you do something 5 times and other ones just one press. It was very easy to get “lost” in just the communication.

be aware that now it is brute force, so large corpora might be a problem. @lewardo had plans of doing fast dtw and might still be able to do it if I manage to convince him of the benefits of volunteering (or if you bribe him)

LSTM is on its way for that.

you could implement a running gesture query - this is just one example. dataseries allow you to add and remove items at various positions, so you could have a rolling thing. I plan to code one soon-ish as demo

thanks - it is hacky indeed. but did the comparison with dataset (in 1) and with knnreg/class in 3/2 helped to understand?

1 Like

I’ve not tested anything with this, but I remember back when doing entrymatcher vs fluid.kdtree~ comparisons (thread) the bruteforce was still quite performant until things got really really big (with the KDTree being faster only above a certain size). (actually revisiting that thread brute force was faster nearly all the time, up to 200k entries which is as far as I tested from the looks of it).

Ooh, nice. I can see that being useful for some of the time stuff I was trying to work out a while back (predicting time series).

Yeah I had a quick poke at this but there’s a bunch I don’t understand about the interface yet and kind of moved onto the next example.

I always prefer contextual examples rather than didactic ones, so I definitely understood after examples 2/3, though those both had the “press one, now press two, not press three, now press four” bouncing around thing which is harder to follow.

1 Like

ok messages for Max and SC users:

Max: there is an interface change. predictSeries makes more sense as we do not predict from a point. I also corrected typos and stuff.

max-v2.zip (4.5 MB)

SC: there is now a version of FluidDataSeries, DTWClassifier, and DTWRegressor. The latter 2 do not yet have a .kr version but you can do some fun stuff with small FluidDataSeries - if anyone is on Windows or Linux and want to try, let me know.

sc-v2.zip (4.2 MB)

Feedback welcome.

p.a.

2 Likes

coming

arrived maybe @tedmoore @spluta and/or @mccrmck will be happy :smiley:

2 Likes

A couple bits:

  • you should remove the zl change in example 2 for p playback. I kept trying to play the same segment again to compare only to realize it wasn’t working.
  • I feel like the segmentation here was different before? each segment now has a huge click at the end (the start of the next segment). I don’t remember that being the case

The rest looks good and works well on M2 mac/Max.

good point - zlchange was good in another patch :slight_smile: