| |
- calculate_obj(X, W, F, L, alpha, beta)
- This function calculates the objective function of NDFS
- kmeans_initialization(X, n_clusters)
- This function uses kmeans to initialize the pseudo label
Input
-----
X: {numpy array}, shape (n_samples, n_features)
input data
n_clusters: {int}
number of clusters
Output
------
Y: {numpy array}, shape (n_samples, n_clusters)
pseudo label matrix
- ndfs(X, **kwargs)
- This function implement unsupervised feature selection using nonnegative spectral analysis, i.e.,
min_{F,W} Tr(F^T L F) + alpha*(||XW-F||_F^2 + beta*||W||_{2,1}) + gamma/2 * ||F^T F - I||_F^2
s.t. F >= 0
Input
-----
X: {numpy array}, shape (n_samples, n_features)
input data
kwargs: {dictionary}
W: {sparse matrix}, shape {n_samples, n_samples}
affinity matrix
alpha: {float}
Parameter alpha in objective function
beta: {float}
Parameter beta in objective function
gamma: {float}
a very large number used to force F^T F = I
F0: {numpy array}, shape (n_samples, n_clusters)
initialization of the pseudo label matirx F, if not provided
n_clusters: {int}
number of clusters
verbose: {boolean}
True if user want to print out the objective function value in each iteration, false if not
Output
------
W: {numpy array}, shape(n_features, n_clusters)
feature weight matrix
Reference:
Li, Zechao, et al. "Unsupervised Feature Selection Using Nonnegative Spectral Analysis." AAAI. 2012.
|