Hello,
I am currently trying to have the active learner run on an SVM with a multiOutput Classifer I built using sklearn recently:
from sklearn.svm import LinearSVC
from sklearn.multioutput import MultiOutputClassifier
# Create the SVM
svm = LinearSVC()
# Make it an Multilabel classifier
multilabel_classifier = MultiOutputClassifier(svm, n_jobs=-1)
# Fit the data to the Multilabel classifier
multilabel_classifier = multilabel_classifier.fit(story_padded_train, schema_train)
# Get predictions for test data
schema_test_pred = multilabel_classifier.predict(story_padded_test)
Then when trying to use modAL the code is such that:
from modAL.models import ActiveLearner
from sklearn.ensemble import RandomForestClassifier
from modAL.multilabel import SVM_binary_minimum
svm_strat = SVM_binary_minimum(
classifier = multilabel_classifier,
X_pool = story_padded_test
)
# initializing the learner
learner = ActiveLearner(
estimator=RandomForestClassifier(),
query_strategy= svm_strat,
X_training=story_padded_train, y_training=schema_train
)
print(learner.score(story_padded_test, schema_test))
Hello, I am currently trying to have the active learner run on an SVM with a multiOutput Classifer I built using sklearn recently:
Then when trying to use modAL the code is such that:
This code will produce an error like so:
The error is shared on multiple mixes of modAL multiLabel strategies and skLearns SVM models. Looking at the documentation at https://scikit-learn.org/stable/modules/classes.html#module-sklearn.svm It seems like none of the models have the estimator attribute which is strange since the doc https://modal-python.readthedocs.io/en/latest/content/apireference/multilabel.html?highlight=multilabel specifically calls for a sklearn SVM model.