Loading the libraries
To run this example, you need to install the following libraries:
mldatasets
to load the datasetpandas
andnumpy
to manipulate itsklearn
(scikit-learn),rulefit
,statsmodels
,interpret
,tf
, andgaminet
to fit models and calculate performance metricsmatplotlib
to create visualizations
Load these libraries as seen in the following snippet:
import math
import mldatasets
import pandas as pd
import numpy as np
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import PolynomialFeatures, StandardScaler,\
MinMaxScaler
from sklearn.model_selection import train_test_split
from sklearn import metrics, linear_model, tree, naive_bayes,\
neighbors, ensemble, neural_network, svm
from rulefit import RuleFit
import statsmodels.api as sm
from interpret.glassbox import ExplainableBoostingClassifier
from interpret import show
from interpret.perf import ROC
import...