anucc / metatone-analysis

Analysing touch-screen performance data using transition matrices.
0 stars 0 forks source link

Currently two representations of TMs #4

Open cpmpercussion opened 7 years ago

cpmpercussion commented 7 years ago

There's currently two representations of TMs in the repo -- this is probably a bad idea.

Charles' representation is as numpy arrays, which are generated for each step in the data frame index and then summed. Advantage is that once the initial step-wise generation is done, the data frame of arrays can be manipulated quickly in different ways (i.e. aggregating the data for different sized windows should be fast).

Ben's representation is as a multi-index data frame with from and to values with columns for each player. The advantage (as far as I understand) is to be more Pandas-y and keep data in a recognisable state (i.e. text labels on gestures) for as long as possible.

I cleaned up the Charles code to a be a lot more clear (transition_matrices.py) and will have a go at implementing the moving window calculations.

Is there a best-practice numpy/pandas/scipy approach? Maybe not as the first two have different philosophies and data structures and the latter is a very broad project. The data is always going to be a bit gross as they are time series of matrices and don't fit quite as neatly into the data frame philosophy (DFs of python objects are sometimes a bit not supported for certain pandas operations, but there are usually decent error messages about it).

Thoughts?

benswift commented 7 years ago

Yeah, this is a known (by me) issue. I'll have a think about it.