# Tips for dimension reduction (Statisticians hate this guy)

**URL:** https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560
**Category:** Learning Resources
**Created:** [July 10, 2020, 10:29am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560 "2020-07-10T10:29:02Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 10, 2020, 10:29am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/1 "2020-07-10T10:29:02Z")

</div>

Apologies for the clickbait-y title of the post I’m going to link but I found it really useful in learning more about how to curate your dimension reduction parameters and algorithm selection. I particularly found it useful as I was interrogating what I thought were a same number of components to reduce to.

@spluta and @rodrigo.constanzo , you seem to be heavily in this space right now with PCA big data sets to search through so perhaps you will find it especially useful!

[https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1006907](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1006907)

---

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [July 10, 2020, 12:46pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/2 "2020-07-10T12:46:50Z")

</div>

Awesome, I’ll have a more detailed read through this.

Don’t know if this is useful across the board, but this chart:

 ![Screenshot 2020-07-10 at 1.43.29 pm](https://discourse.flucoma.org/uploads/default/original/1X/c1c87493945f7af5b58d6fad7a3485a2d62e6021.png)

Reminded me of `fluid.bufnndsvd~`, so I wonder if there is (or will be) a way to know how many dimensions are “sufficient” with any given dataset.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 10, 2020, 12:58pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/3 "2020-07-10T12:58:46Z")

</div>

I naively take 10% of my points as my lower limit and work upwards if its garbage. Today I’ve had great success going from 273 values to 1 though. The one dimension that all the samples sits on is muddy, but 0.1 versus 0.9 are two distinct points which is quite interesting.

---

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [July 10, 2020, 1:17pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/4 "2020-07-10T13:17:16Z")

</div>

> [@jamesbradbury](#):
>
> I naively take 10% of my points as my lower limit and work upwards if its garbage. Today I’ve had great success going from 273 values to 1 though.

What are you using to assess this?  
Like matching, or looking at some kind of 2d representation, or some kind of difference-ness metric?

---

<div class="post-metadata">

### Author: ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)
#### Post date: [July 10, 2020, 1:43pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/5 "2020-07-10T13:43:12Z")

</div>

this could be good to talk about later today indeed.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 10, 2020, 1:45pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/6 "2020-07-10T13:45:20Z")

</div>

How good whatever happens afterwards is 😛

For clustering it works quite well, but who knows for other applications not yet imagined or implemented.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 10, 2020, 1:45pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/7 "2020-07-10T13:45:50Z")

</div>

Yes please 🙂 I remember hearing about some rules of thumbs for DR that are dependent on how many vectors you have and how many samples per vector you’ve got too.

---

<div class="post-metadata">

### Author: ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)
#### Post date: [July 10, 2020, 1:49pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/8 "2020-07-10T13:49:10Z")

</div>

> [@jamesbradbury](#):
>
> DR that are dependent on how many vectors you have and how many samples per vector you’ve got too

this kind of wisdom is from @groma and @weefuzzy though…

---

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [July 10, 2020, 1:54pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/9 "2020-07-10T13:54:30Z")

</div>

> [@jamesbradbury](#):
>
> How good whatever happens afterwards is

But by this, do you mean “listening” or whatever? Like a subjective measure of effectiveness, or is it getting x amount of clusters, or something numerical/“concrete” like that.

> [@jamesbradbury](#):
>
> …and how many samples per vector you’ve got too.

I’ve been wondering about this too, to see if/how DR stuff works on time series of events (based on [all the recent AudioGuide discussions](https://discourse.flucoma.org/t/audioguide-talk/550/17)). Like, if instead of putting a statistical summary into a `fluid.dataset~` and then reducing that down to x amount of dimension, putting _every frame_ of the analysis into a `fluid.dataset~`, and seeing if it can/does somehow summarize change-over-time-ness, as a way of getting better morphological matches (in a kdtree context).

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 10, 2020, 2:35pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/10 "2020-07-10T14:35:46Z")

</div>

I had a suspicion that that’s where the wisdom came from 🙂 If only I could remember the details of the advice.

---

<div class="post-metadata">

### Author: ![spluta](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/spluta/32/21_2.png) [@spluta](https://discourse.flucoma.org/u/spluta)
#### Post date: [July 10, 2020, 2:56pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/11 "2020-07-10T14:56:03Z")

</div>

This Simple Trick is Driving Statisticians in Valparaiso, In Crazy (BIG PAYDAY!!!)

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 10, 2020, 4:50pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/12 "2020-07-10T16:50:39Z")

</div>

> [@rodrigo.constanzo](#):
>
> But by this, do you mean “listening” or whatever? Like a subjective measure of effectiveness, or is it getting x amount of clusters, or something numerical/“concrete” like that.

I audition the queries in Max using a dict object to load my outputs. I generally loop the samples and just iterate over the clusters to see homogenous they are.

---

<div class="post-metadata">

### Author: ![bafonso](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/bafonso/32/771_2.png) [@bafonso](https://discourse.flucoma.org/u/bafonso)
#### Post date: [July 13, 2020, 3:08am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/13 "2020-07-13T03:08:21Z")

</div>

Have people compared using PCA, LDA and ICA ? In my data world experience they do provide different results which is expected since they’re maximizing different things.

I’d be curious to see how this translates to audio but not sure if anything else is implemented in flucoma or max besides pca.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [July 13, 2020, 8:59am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/14 "2020-07-13T08:59:35Z")

</div>

There is multidimensional scaling also in the `fluid.mds~` object

---

<div class="post-metadata">

### Author: ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)
#### Post date: [July 13, 2020, 9:30am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/15 "2020-07-13T09:30:16Z")

</div>

and there is a cool paper we published [here](https://pure.hud.ac.uk/en/publications/adaptive-mapping-of-sound-collections-for-data-driven-musical-int) where we discuss the various affordances of such differences in interface building 🙂

---

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [July 13, 2020, 9:58am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/16 "2020-07-13T09:58:52Z")

</div>

Going to start my experiments with this stuff soon, as I’m going to do some MFCC testing, and the dimensions required balloon up really fast.

I’ll read through the paper, and do some playing, but I’m curious/wondering how to retain a _perceptually meaningful_ set of dimensions at the end? Like, loudness (and its related statistics) are probably more significant than a single MFCC band, but if I understand things correctly, they would both have the same amount of “weight” in any dimensionality reduction context.

---

<div class="post-metadata">

### Author: ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)
#### Post date: [July 13, 2020, 10:14am UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/17 "2020-07-13T10:14:57Z")

</div>

> [@rodrigo.constanzo](#):
>
> Like, loudness (and its related statistics) are probably more significant than a single MFCC band,

what I plan to do when I have time to actually use the tools is to take the APT patch and to make a 1D redux of MFCC1-13 (12 to 1) and scale that into the same range (0-110) than my tolerance in dB and midifloats… but feel free to go there and share. I just noticed that this is in the wrong part of the forum so sorry @bafonso there are tools still not public… in early 2021, and if you want maybe a bit earlier when we get to beta of what is currently alpha…

---

<div class="post-metadata">

### Author: ![bafonso](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/bafonso/32/771_2.png) [@bafonso](https://discourse.flucoma.org/u/bafonso)
#### Post date: [July 17, 2020, 4:15pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/18 "2020-07-17T16:15:48Z")

</div>

I’d be happy to test/play with beta or alpha versions of things to come and give you feedback 🙂

---

<div class="post-metadata">

### Author: ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)
#### Post date: [July 17, 2020, 4:29pm UTC](https://discourse.flucoma.org/t/tips-for-dimension-reduction-statisticians-hate-this-guy/560/19 "2020-07-17T16:29:41Z")

</div>

ok I’ll put you on the list for the beta. Thanks!
