<jupyter_start><jupyter_text>Scaling<jupyter_code>cols = [var for var in X_train.columns if X_train[var].dtypes !='O']

cols
# let's apply the standard scaler on the above variables

scaler = SklearnTransformerWrapper(transformer = StandardScaler(),
                                    variables = cols)

scaler.fit(X_train.fillna(0))
X_train = scaler.transform(X_train.fillna(0))
X_test = scaler.transform(X_test.fillna(0))
# mean values, learnt by the StandardScaler
scaler.transformer.mean_
# std values, learnt by the StandardScaler
scaler.transformer.scale_
# the mean of the scaled variables is 0
X_train[cols].mean()
# the std of the scaled variables is ~1

X_train[cols].std()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10084033613445378, 'fraction_numerical': 0.0070028011204481795, 'mean_word_length': 4.674603174603175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '615137', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 246, 'n_tokens_neox': 238, 'n_words': 61, 'path': 'examples/wrappers/Sklearn-wrapper-plus-scalers.ipynb', 'repo_name': 'indymnv/feature_engine', 'size': '714'}