You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the code implemented in the calculation of trace ratio, if we set s_within and s_between to have a length of n_selected_features. Then the variables "I" and "idx" will just have a length of n_selected_features. In this case, arent we just restricting the selected features to be the first n_selected_features in fs_idx and the loop is essentially updating/optimizing nothing?
# preprocessing
fs_idx = np.argsort(np.divide(s_between, s_within), 0)[::-1]
k = np.sum(s_between[0:n_selected_features])/np.sum(s_within[0:n_selected_features])
s_within = s_within[fs_idx[0:n_selected_features]]
s_between = s_between[fs_idx[0:n_selected_features]]
# iterate util converge
count = 0
while True:
score = np.sort(s_between-k*s_within)[::-1]
I = np.argsort(s_between-k*s_within)[::-1]
idx = I[0:n_selected_features]
old_k = k
k = np.sum(s_between[idx])/np.sum(s_within[idx])
if verbose:
print('obj at iter {0}: {1}'.format(count+1, k))
count += 1
if abs(k - old_k) < 1e-3:
break
The text was updated successfully, but these errors were encountered:
Based on the code implemented in the calculation of trace ratio, if we set s_within and s_between to have a length of n_selected_features. Then the variables "I" and "idx" will just have a length of n_selected_features. In this case, arent we just restricting the selected features to be the first n_selected_features in fs_idx and the loop is essentially updating/optimizing nothing?
The text was updated successfully, but these errors were encountered: