modAL-python / modAL

A modular active learning framework for Python
https://modAL-python.github.io/
MIT License
2.23k stars 324 forks source link

How to use the KL_max_disagreement function in my SVM Active Learining project? #137

Closed chanyyyy closed 3 years ago

chanyyyy commented 3 years ago

Hi.

I'm trying to train a sklearn.svm.SVC() model with a multilabel dataset by using KL-MAX strategy, and I don't know how to create a committee for the KL_max_disagreement function.

I splitted the dataset to X_V(1%), X_U(69%) and X_Test(30%), and after SVC().fit(X_V,Y_V), I want to return 1% indexes of the data from X_U which are most useful for the learning per iter. However I completely don't know how to use the KL_max_disagreement function, I only have one SVC() model and I tried

committee = modAL.Committee(
        learner_list=[model],
        query_strategy=KL_max_disagreement
    )

It obviously doesn't work, raise an AttributeError: 'SVC' object has no attribute 'estimator'. And I really don't know how am I supposed to go on.

I'm a green hand and I sincerely hope that someone can teach me how to make it.