Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Principal Components Analysis (PCA) - Color Labeled Biplot

pierrelouisbescond
8 - Asteroid

Hi Everyone,
I am building a Principal Components Analysis from 25 records and got the following biplot (so far, so good!):

 

pierrelouisbescond_2-1639401131535.png

 

 

I'd like to color the dots according to the corresponding labels (from Label_01 to Label_11, included in the dataset) while also preserving the arrows associated with each parameter (X1, X2, ...) and get an output like the one from the Iris PCA analysis and help the plot interpretation:

 

eIUiR.png

I believe I should try to modify the original "Principal Components Analysis" tool but I do not know R and I am afraid to get lost and do worse than good.

 

Is there anyone here who could give me some tips on how to achieve this? (I have included the corresponding workflow with data)

 

Thanks,
Pierre-Louis

 

 

6 REPLIES 6
OllieClarke
15 - Aurora
15 - Aurora

@pierrelouisbescond no need to mess with R, just use the Interactive chart tool to build your own report 🙂

OllieClarke_0-1639409376123.png

 

More info on the tool here: https://help.alteryx.com/20213/designer/interactive-chart-tool

 

pierrelouisbescond
8 - Asteroid

Hi @OllieClarke,

Thanks a lot for the suggestion but I forgot to mention that I need to keep the arrows corresponding to the different parameters and I think that only a "true" PCA output can do that.

 

OllieClarke
15 - Aurora
15 - Aurora

Hey @pierrelouisbescond I had a look in the R tool that makes the PCA output, and it uses the biplot() function from the Stats package to do this. Unfortunately it looks like you can only have 2 colours in the biplot, so cannot colour by group. There are other R packages/functions which allow you to create multi-coloured PCA plots, but you would need to write your own R code to do this (or python if you prefer that). 

OllieClarke_0-1639490933946.png

 

pierrelouisbescond
8 - Asteroid

Hi @OllieClarke,

Thanks a lot for investigating! It seems that R libraries such as "factoextra" could to do the trick so I'll explore this path. If I am successful, I'll add the corresponding workflow here 😁 🤞

OllieClarke
15 - Aurora
15 - Aurora

Thanks @pierrelouisbescond best of luck 👍

pierrelouisbescond
8 - Asteroid

Hi @OllieClarke 
Happy to be back with a working solution and its corresponding workflow: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Create-a-label-colored-Principal-Compo... .
I should have used this GIF last Wednesday...
illbeback.gif

Labels