Fix random state to make tests pass

Signed-off-by: abigailt <abigailt@il.ibm.com>
This commit is contained in:
abigailt 2022-12-21 09:51:13 +02:00 committed by abigailgold
parent ba88bc09ba
commit a76c3d2714

View file

@ -236,11 +236,11 @@ class GeneralizeToRepresentative(BaseEstimator, MetaEstimatorMixin, TransformerM
try:
X_train, X_test, y_train, y_test = train_test_split(x, dataset.get_labels(),
stratify=dataset.get_labels(), test_size=0.4,
random_state=14)
random_state=18)
except ValueError:
print('Could not stratify split due to uncommon class value, doing unstratified split instead')
X_train, X_test, y_train, y_test = train_test_split(x, dataset.get_labels(), test_size=0.4,
random_state=14)
random_state=18)
X_train_QI = X_train.loc[:, self.features_to_minimize]
X_test_QI = X_test.loc[:, self.features_to_minimize]