diff --git a/skfeature/function/similarity_based/lap_score.py b/skfeature/function/similarity_based/lap_score.py index 5bee2f8..f83257c 100644 --- a/skfeature/function/similarity_based/lap_score.py +++ b/skfeature/function/similarity_based/lap_score.py @@ -32,8 +32,10 @@ def lap_score(X, **kwargs): # if 'W' is not specified, use the default W if 'W' not in kwargs.keys(): W = construct_W(X) - # construct the affinity matrix W - W = kwargs['W'] + + else: + # construct the affinity matrix W + W = kwargs['W'] # build the diagonal D matrix from affinity matrix W D = np.array(W.sum(axis=1)) L = W