I have a dataframe which looks like this:
label predicted F1 F2 F3 .... F40
major minor 2 1 4
major major 1 0 10
minor patch 4 3 23
major patch 2 1 11
minor minor 0 4 8
patch major 7 3 30
patch minor 8 0 1
patch patch 1 7 11
I have label
which is the true label for the id
(not shown as it is not relevant), and predicted
label, and then set of around 40 features in my df.
The idea is to transform these 40 features into 2 dimensions and visualize them true vs predicted. We have 9 cases for all the three labels major
,minor
and patch
vs their predictions.
With PCA, it is not able to capture much variance with 2 components and I am not sure how to map the PCA values with the labels and predictions in the original df as a whole. A way to achieve this is to separate all cases into 9 dataframes and achieve the result, but this isn't what I am looking for.
Is there any other way I can reduce and visualize the given data? Any suggestions would be highly appreciated.