From fdba797860d785592cabb6bf8fac76158a10423f Mon Sep 17 00:00:00 2001 From: "Shaheryar(Shery) Khan" Date: Fri, 2 Apr 2021 19:00:35 +0100 Subject: [PATCH] updated lap_score.py to include else statement to avoid key error else statement for kwargs['W'] when no kwargs provided --- skfeature/function/similarity_based/lap_score.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skfeature/function/similarity_based/lap_score.py b/skfeature/function/similarity_based/lap_score.py index 5bee2f8..bfaec90 100644 --- a/skfeature/function/similarity_based/lap_score.py +++ b/skfeature/function/similarity_based/lap_score.py @@ -33,7 +33,8 @@ def lap_score(X, **kwargs): if 'W' not in kwargs.keys(): W = construct_W(X) # construct the affinity matrix W - W = kwargs['W'] + else: + W = kwargs['W'] # build the diagonal D matrix from affinity matrix W D = np.array(W.sum(axis=1)) L = W