For this example, our goal is to predict
RiskPerformance from the
For this example, we will be training
CatBoost Classifierand then use ExplainX to provide business-level explanations and performing debugging tasks.
Let's start by opening up our Jupyter Notebook.
Install relevant packages
!pip install catboost!pip install explainx
Import the library
from explainx import *import catboostfrom sklearn.model_selection import train_test_split
Load and pre-process the dataset for model-building. The dataset can be easily accessible from within the explainX library.
#Load DatasetX_Data, Y_Data = explainx.dataset_heloc()#Split data into train and testX_train, X_test, Y_train, Y_test = train_test_split(X_Data, Y_Data, test_size=0.2, random_state=0)
Let's train our CatBoost model.
#Run CatBoost Modelmodel = CatBoostClassifier(iterations=500, learning_rate=0.3, depth=2)#Fit Modelmodel.fit(X_train.to_numpy(), Y_train)
Let's call the explainX function and pass the parameters.
explainx.ai(X_Test, Y_Test, model, model_name="catboost")
Once the explainX function is done running, you can simply click on the application link to access the explainX dashboard.
App running at https://127.0.0.1:8050
In the next part, we will continue our predicting RiskPerformance with CatBoost example. Let's dive right into explaining the model behavior and model predictions.