explainer <- lime(text_train, # the input
model = r, # the model
preprocess = tokenize_text) # the preprocessing step
explanation <- explain(text_test[2:5],
explainer = explainer,
n_labels = 1, # show only 1 label (recommend or not recommend)
n_features = 5,
feature_select = "highest_weights", # use all terms to explain the model
single_explanation = F)
it gives error
Error: The class of model must have a model_type method. See ?model_type to get an overview of models supported out of the box
I have a randomForest model and when I run
explainer <- lime(text_train, # the input model = r, # the model preprocess = tokenize_text) # the preprocessing step
explanation <- explain(text_test[2:5], explainer = explainer, n_labels = 1, # show only 1 label (recommend or not recommend) n_features = 5, feature_select = "highest_weights", # use all terms to explain the model single_explanation = F)
it gives error
Error: The class of model must have a model_type method. See ?model_type to get an overview of models supported out of the box
How to have a model_type ()