Skip to content

Commit

Permalink
Small fix for clustering for the cases in which clustering fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andlessa committed Oct 10, 2024
1 parent b6b51bc commit 2564bcf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions smodels/matching/clusterTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ def clusterTo(centroids,smsList,dataset,maxDist):
smsArray = np.array(smsList)
clusterObjs = []
for indexList in clusters:
if not indexList:
continue
smsCluster = SMSCluster(smsArray[indexList].tolist())
# Check if the cluster is valid:
is_valid = smsCluster.isValid(dataset)
Expand Down

0 comments on commit 2564bcf

Please sign in to comment.