My goal is to get the most important features for each class in a text classification task. I created the model, learner and predictor like this:
t = text.Transformer(model_name, maxlen=MAX_SEQ_LENGTH, class_names=emotions)
trn = t.preprocess_train(X_train.values, y_train.values)
val = t.preprocess_test(X_test.values, y_test.values)
model = t.get_classifier()
learner = ktrain.get_learner(model, train_data=trn, val_data=val, batch_size=BATCH_SIZE)
predictor = ktrain.get_predictor(learner.model, preproc=t)
Is there any way to get the top features like this:
(created for SVM)
