Change text size of LIME show_in_notebook

530 Views Asked by At

I was reading this tutorial on LIME which showed how to visualise the result of a prediction by executing this code

import pandas as pd
import numpy as np
import lime
import matplotlib.pyplot as plt
import random
import warnings
warnings.filterwarnings("ignore")

from sklearn.datasets import load_boston
boston = load_boston()
boston_df = pd.DataFrame(data=boston.data, columns = boston.feature_names)
boston_df["Price"] = boston.target

from sklearn.model_selection import train_test_split
X, Y = boston.data, boston.target
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, train_size=0.90, test_size=0.1, random_state=123, shuffle=True)

from sklearn.linear_model import LinearRegression
lr = LinearRegression()
lr.fit(X_train, Y_train)

from lime import lime_tabular
explainer = lime_tabular.LimeTabularExplainer(X_train, mode="regression", feature_names= boston.feature_names)
idx = random.randint(1, len(X_test))
explanation = explainer.explain_instance(X_test[idx], lr.predict, num_features=len(boston.feature_names))
explanation.show_in_notebook()

The code produced this graph

enter image description here

My question is: how can I change the text size for the words negative and positive in that graph? I searched the docs but couldn't find any info on that matter.

0

There are 0 best solutions below