Closed diegocasmo closed 6 years ago
So the input is an array of facial expressions?
We can figure out the principal components, but it will vary dataset to dataset.
I'm also a bit confused about this, since PCA creates the principal components based on variance, which is dependent on the measurements :/
I think we have a good start on this in a branch, we need to resolve the accuracy drop (I imagine) we'll get when we take out PCA. Might sit on this a bit for Monday.
I may be wrong, but I have been thinking about this, and maybe we won't need to take PCA out of the equation at all, instead we'll used it normally as we always do. PCA selects n
components that have the largest possible variance (not n
features!). So unless the input face is an outlier, this should be fine.
We need variance across a single column, one row gives no good results. Two rows not much better.
import numpy as np
from sklearn.decomposition import PCA
pca = PCA(n_components = 5, whiten = True)
principal_components = pca.fit_transform(np.array([[1,2,3,4,5,6,7,8,9,11]]))
principal_components
This should help: https://github.com/scikit-learn/scikit-learn/blob/a24c8b464d094d2c468a16ea9f8bf8d42d949f84/sklearn/decomposition/base.py#L99. I think X
is pca.components_
.
Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html#sklearn.decomposition.PCA.transform
Notes: