0
$\begingroup$

Tl;dr how can I encode a feature that has multiple distinct states each with different numbers of parameters. Am I going to have to break this into multiple models?

I'm sorry, I'm sure this has been asked before, but there's a vocab word I don't know, so I've been researching in circles.

Specifically, I want to encode music data, where pitches are different distances from each other, but all pitches are the same distance from silence.

I don't need silence to literally be a null value, but I can't just encode it as zero either. Silence is a valid category, but it's not on the same dimension as pitch.

What is the vocab word I need to research this further? Everything I'm finding says how to fill in null values with no consideration as to whether or not null is a valid answer. And it looks like the other people doing machine learning on music haven't found a good answer either.

Edit: So far this seems to be the closest answer, but it doesn't work because null represents an unknown in that example which does not add information, whereas in my case, null is a known value, that does add information

$\endgroup$
4
  • $\begingroup$ "where pitches are different distances from each other, but all pitches are the same distance from silence" describes a measurement that is decidedly not ordinal! You could use techniques of circular-statistics. It's hard to give any advice without knowing more about how the pitches will be used in the model. $\endgroup$
    – whuber
    Commented Sep 10, 2020 at 21:56
  • $\begingroup$ I understand that the relationship to silence isn't ordinal, but is the relationship of pitches to each other not ordinal either? And thank you tremendously! I'm looking into circular statistics immediately $\endgroup$
    – MacKenzie
    Commented Sep 10, 2020 at 22:03
  • 1
    $\begingroup$ Okay, so thinking about it circularly may have just saved me an insane number of parameters while giving me what I hope will be a game-changing insight, so bless you for that. But I don't see where it allows for empty values anymore than a single float parameter would. My data doesn't have any info to justify an assumption that I can meaningfully interpolate between silence and sound. I really need a binary switch for sound or silence, and give me the pitch only if it's not silent. Are there any encoding strategies that meet this requirement? $\endgroup$
    – MacKenzie
    Commented Sep 11, 2020 at 1:03
  • $\begingroup$ Yes: simply create a dummy (indicator) variable for silence. Or, if you place the pitches around a short arc on a circle, you would find it reasonable to encode their locations in terms of the x and y coordinates (the cosine and sine of the angle) and to encode silence as the origin, (0,0). $\endgroup$
    – whuber
    Commented Sep 11, 2020 at 14:14

1 Answer 1

0
$\begingroup$

Okay, it's really looking like there's no way to avoid dummy variables, as suggested by whuber. Since silence is a different dimension than pitch, there isn't a way to get around adding another dimension to account for it. There's a lot of weird tricks you can try, but that extra dimension has to happen somewhere.

As for the other side of the question, if google sends anyone working on music in machine learning here, the keyword that helped my searches was "tonnetz". https://arxiv.org/pdf/1709.00375.pdf

And I'll hopefully save you a lot of heartache trying to break down the traditional tonnetz that you'll see, where rightward motion represents going up a major fifth and going up and to the right represents a major third:

That whole thing simplifies down to

pitch = 3x + y

I'll probably post a more in-depth explanation, but for now, just look at this grid

2  5  8 11
1  4  7 10
0  3  6  9

until you see how it's the same as the tonnetz. You can still draw all the same lines between everything, but now we can just give our algorithms a vector (x, y) that satisfies the equation pitch = 3x + y

Since it's not possible to invert this process without choosing a subset with no duplicates, I figure we can use

x = integer(pitch / 3)
y = pitch % 3

I'm sure this can be extended to other kinds of tonnetz, but this concludes my contribution for now.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.