Skip to content

Commit 0145e41

Browse files
Merge pull request #318 from MichalChromcak/fix_random_state
Fix shuffle and random state in NestedCVWrapper init
2 parents 9189d44 + dcfc4b5 commit 0145e41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

category_encoders/wrapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class PolynomialWrapper(BaseEstimator, TransformerMixin):
4040
>>> X = pd.DataFrame(bunch.data, columns=bunch.feature_names)
4141
>>> enc = TargetEncoder(cols=['CHAS', 'RAD'])
4242
>>> wrapper = PolynomialWrapper(enc)
43-
>>> encoded =wrapper.fit_transform(X, y)
43+
>>> encoded = wrapper.fit_transform(X, y)
4444
>>> print(encoded.info())
4545
"""
4646

@@ -204,6 +204,8 @@ class NestedCVWrapper(BaseEstimator, TransformerMixin):
204204
def __init__(self, feature_encoder, cv=5, shuffle=True, random_state=None):
205205
self.feature_encoder = feature_encoder
206206
self.__name__ = feature_encoder.__class__.__name__
207+
self.shuffle = shuffle
208+
self.random_state = random_state
207209

208210
if type(cv) == int:
209211
self.cv = StratifiedKFold(n_splits=cv, shuffle=shuffle, random_state=random_state)

0 commit comments

Comments
 (0)