| |
- calculate_obj(X, y, w, lambda1, lambda2, T)
- feature_ranking(w)
- graph_fs(X, y, **kwargs)
- This function implement the graph structural feature selection algorithm GOSCAR
Objective Function
min_{w} 1/2 ||X*w - y||_F^2 + lambda1 ||w||_1 + lambda2 \sum_{(i,j) \in E} max{|w_i|, |w|_j}
Input:
X: {numpy array}, shape (n_samples, n_features)
Input data, guaranteed to be a numpy array
y: {numpy array}, shape (n_samples, 1)
Input data, the label matrix
edge_list: {numpy array}, shape (n_edges, 2)
Input data, each row is a pair of linked features, note feature index should start from 0
lambda1: {float}
Parameter lambda1 in objective function
lambda2: {float}
Parameter labmda2 in objective function
rho: {flot}
parameter used for optimization
max_iter: {int}
maximal iteration
verbose: {boolean} True or False
True if we want to print out the objective function value in each iteration, False if not
Output:
w: the weights of the features
obj: the value of the objective function in each iteration
- soft_threshold(A, b)
- This function implement the soft-threshold operator
Input:
A: {numpy scalar, vector, or matrix}
b: scalar}
|