Skip to content

Wrong Calculations When Computing Bsas Algorithm in the Library #707

@Ahmed-Nezar

Description

@Ahmed-Nezar

Consider this example:

data_points = [
    (2, 5),  
    (6, 4),  
    (5, 3),  
    (2, 2),  
    (1, 4),  
    (5, 4),  
    (3, 3),  
    (2, 3),  
    (2, 4),  
    (8, 2),  
    (9, 2),  
    (10, 2), 
    (11, 2), 
    (10, 3), 
    (9, 1)   
]
metric = distance_metric(type_metric.MANHATTAN)
bsas_instance = bsas(data_points, maximum_clusters=3, threshold=1.5, metric=metric)
bsas_instance.process()
clusters = bsas_instance.get_clusters()
representatives = bsas_instance.get_representatives()

Output of clusters is [[0, 3, 4, 7, 8], [1, 5, 9, 10, 11, 12, 13, 14], [2, 6]] the 6th point (3,3) should be assigned to cluster 1 not cluster 3 or I am getting something wrong here in the Algorithm implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions