transform
method transform(X, y=None, pipeline=None, verbose=None)
[source]
Transform new data through all transformers in the current branch. By
default, transformers that are applied on the training set only are
not used during the transformations. Use the pipeline
parameter to
customize this behaviour. This method can only be called from atom,
not from the models.
Parameters: |
X: dict, list, tuple, np.ndarray or pd.DataFrame
Transformers to use on the data before predicting.
verbose: int or None, optional (default=None) |
Returns: |
X: pd.DataFrame
y: pd.Series |
Example
from atom import ATOMClassifier
atom = ATOMClassifier(X, y)
atom.clean()
atom.impute(strat_num="knn", strat_cat="drop")
atom.prune(strategy="z-score", method="min_max", max_sigma=2)
# Transform new data through all transformers in the branch
X_transformed = atom.transform(X_new)