Hi , i have a groups of messages each one containing an array, or a groups of numbers in this way:
[ 2, 5, 1, 3, 5 (
[ 2, 1, 5, 9, 1 (
[ 5, 3, 1, 8, 5 (
[ 7, 7, 3, 8, 2 (
... and so on
How can i order each one of these arrays (messages) based in its similarities? i need that the most similar ones can be neighbours, so i can trigger them in a ordered way
how can i achieve this?
thanks
R.
Probably the simplest first approach,
https://en.wikipedia.org/wiki/Euclidean_distance
But then, for music (I'm making a guess here), each dimension is not equally weighted, so if your first column represents the root key then you might want to give that more clout.
There are more elaborate _" distance function "_ you can research.
On Mon, Mar 05, 2012 at 01:37:27AM +0200, ronni montoya wrote:
Hi , i have a groups of messages each one containing an array, or a groups of numbers in this way:
[ 2, 5, 1, 3, 5 (
[ 2, 1, 5, 9, 1 (
[ 5, 3, 1, 8, 5 (
[ 7, 7, 3, 8, 2 (
... and so on
How can i order each one of these arrays (messages) based in its similarities? i need that the most similar ones can be neighbours, so i can trigger them in a ordered way
how can i achieve this?
thanks
R.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Le 2012-03-05 à 01:37:00, ronni montoya a écrit :
How can i order each one of these arrays (messages) based in its similarities? i need that the most similar ones can be neighbours, so i can trigger them in a ordered way how can i achieve this?
Similarity is not just one concept, it's a wide variety of related concepts. You need to figure out in which manner you'd do it. First look at which combinations you would like to be considered completely equivalent, or very much equivalent.
e.g. is the list 1 23 456 7890 as very much like the list 456 7890 1 23 ? If so, why ? (there are several possible reasons, very different from each other)
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
If you do end up treating each of your messages like a vector, the [choice] extern is good for this kind of thing. But you have to implement the weighting on your own before sending anything to it.
On Sun, Mar 4, 2012 at 7:28 PM, Mathieu Bouchard matju@artengine.ca wrote:
Le 2012-03-05 à 01:37:00, ronni montoya a écrit :
How can i order each one of these arrays (messages) based in its similarities? i need that the most similar ones can be neighbours, so i can trigger them in a ordered way how can i achieve this?
Similarity is not just one concept, it's a wide variety of related concepts. You need to figure out in which manner you'd do it. First look at which combinations you would like to be considered completely equivalent, or very much equivalent.
e.g. is the list 1 23 456 7890 as very much like the list 456 7890 1 23 ? If so, why ? (there are several possible reasons, very different from each other)
______________________________________________________________________ | Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Le 2012-03-05 à 09:09:00, William Brent a écrit :
If you do end up treating each of your messages like a vector, the [choice] extern is good for this kind of thing. But you have to implement the weighting on your own before sending anything to it.
Vector is a quite polysemic word... it's nice to note that «vector» here means a Hilbert space using a plain dot-product. Meaning that the concept doesn't have so much to do with std::vector (C++) nor java.util.Vector (Java).
Also one other thing to note, is that it doesn't compute the euclidean distance between points, which is the other easiest possible comparison.
If you have three numbers a b c that you wish to compare with x y z, the dot-product used in your solution is a*x+b*y+c*z, which is then divided by sqrt((a²+b²+c²)*(x²+y²+z²)), a scale factor that brings back the similarity to something between -1 and +1. In that case, +1 is the best match, -1 is the best backwards match (if you use negatives), and 0 is the most unrelated thing possible.
The euclidean distance, however, is sqrt((a-x)²+(b-y)²+(c-z)²).
The dot-product thing is like comparing angles between arrows, to find which arrow is in the most similar direction ; and the euclidean distance is like comparing distances between points, to find which is closest.
Both are extremely common and useful.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC