ntucllab / libact

Pool-based active learning in Python
http://libact.readthedocs.org/
BSD 2-Clause "Simplified" License
777 stars 175 forks source link

Hierarchical clustering #185

Closed QajikHakobyan closed 3 years ago

QajikHakobyan commented 3 years ago

Got an assertion error, while doing query and update in herarchical clustering. `y = [] for idx in range(len(y_pool)): if idx in seed_set: y += [y_pool[idx]] else: y += [None] dataset = Dataset(X_pool, y)

sub_qs = UncertaintySampling( dataset, method='sm', model=libact.models.LogisticRegression(max_iter=1000)) qs = HierarchicalSampling( dataset, # Dataset object np.unique(y_pool), active_selecting=True, subsample_qs=sub_qs )

for idx in range(100): a = qs.make_query() qs.update(a, y_pool[a]) qs.sub_qs.update(a, y_pool[a])

`

query_update

yangarbiter commented 3 years ago

@sian-chen Could you answer this question?

Thanks.

QajikHakobyan commented 3 years ago

@sian-chen Could you please provide an working example with hierarchical sampling

ariapoy commented 3 years ago

@sian-chen Could you please provide an working example with hierarchical sampling

@QajikHakobyan I write the working example and clarify this issue here. Please check it!

I consider that the AssertionError occurs as you only use query strategy update. When next time qs.make_query(), the former corresponded labeled in dataset doesn't update.

Please check the example of Comparing Different Query Strategies to get more examples.

Thanks.