I have to write a classifier (Gaussian Mixture model) to use for human action recognition. I have 4 dataset of video, each of them contains 12 action that I want to recognize. I choose 3 of them as training set and 1 of them as testing set. For each frame I extract 907 features that are my observations. Before I apply the GM model on the training set I run PCA on it. So I consider only 50 components.
I construct the GM model with one cluster of each action.
gm = gmdistribution.fit(data, cluster_num, 'Options', options, 'CovType','diagonal','Regularize', 1e-10, 'SharedCov', true);
Now I want to have a visual feedback to understand if the clustering worked well or the data are misclassified.
Is it possible have something like this?
Gaussian mixture models (GMMs) are often used for data clustering. You can use GMMs to perform either hard clustering or soft clustering on query data. To perform hard clustering, the GMM assigns query data points to the multivariate normal components that maximize the component posterior probability, given the data.
Cluster the Data Using the Fitted GMMcluster implements "hard clustering", a method that assigns each data point to exactly one cluster. For GMM, cluster assigns each point to one of the two mixture components in the GMM. The center of each cluster is the corresponding mixture component mean.
K-Means and Gaussian Mixture Model (GMM) are unsupervised clustering techniques. K-Means groups data points using distance from the cluster centroid [8] - [16]. GMM uses a probabilistic assignment of data points to clusters [17] - [19]. Each cluster is described by a separate Gaussian distribution.
I am not near the code I wrote to make these, but I remember which functions are worth looking at.
Start here with plot_gaussian_ellipsiod. You can further add gmdistribution
and ezcontour
to end up with something like this:
Or, for 3d data, you could use plot3
and plot_gaussian_ellipsiod
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With