Published April 28, 2022 | Version 1.0

One Classifier Ignores a Feature

Authors/Creators

Description

The data sets are used in a controlled experiment, where two classifiers should be compared. train_a.csv and explain.csv are slices from the original data set. train_b.csv contains the same instances as in train_a.csv, but with feature x1 set to 0 to make it unusable to classifier B.

The original data set was created and split using this Python code:

from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression

X, y = make_classification(n_samples=300, n_features=2, n_redundant=0, n_informative=2,
                           n_clusters_per_class=1, class_sep=0.75, random_state=0)
X *= 100

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=0)
lm = LogisticRegression()
lm.fit(X_train, y_train)
clf_a = lm

clf_b = LogisticRegression()
X2 = X.copy()
X2[:, 0] = 0
X2_train, X2_test, y2_train, y2_test = train_test_split(X2, y, test_size=0.5, random_state=0)
clf_b.fit(X2_train, y2_train)

X_explain = X_test
y_explain = y_test

Files

explain.csv

Files (15.5 kB)

Name Size Download all
md5:c9118c4eef29b58a3c514e1b7d728c12
5.9 kB Preview Download
md5:25e38e75318fb0c4db9e9d6d2fdf7884
5.9 kB Preview Download
md5:0800933ebeac90cc9f9e9e92a641c9ca
3.7 kB Preview Download