# Path: skutil/utils/fixes.py
# def _cols_if_none(X, self_cols):
#     """Since numerous transformers in the preprocessing
#     and feature selection modules take ``cols`` arguments
#     (which could end up as ``None`` via the ``validate_is_pd``
#     method), this will return the columns that should be used.
# 
#     Parameters
#     ----------
# 
#     X : Pandas ``DataFrame``
#         The data frame being transformed.
# 
#     self_cols : list (string) or None
#         The columns.
#     """
#     return X.columns.tolist() if not self_cols else self_cols


import numpy as np
import pandas as pd
from scipy import optimize
from scipy.stats import boxcox
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.externals import six
from sklearn.externals.joblib import Parallel, delayed
from sklearn.preprocessing import StandardScaler
from sklearn.utils.validation import check_is_fitted
from skutil.base import *
from ..utils import *
from ..utils.fixes import _cols_if_none
        if not hasattr(self.fun_, '__call__'):
            raise TypeError('require callable for interaction_function')

        # validate cols
        if len(cols) < 2:
            raise ValueError('need at least two columns')

        return self

    def transform(self, X):
        """Transform a test matrix given the already-fit transformer.

        Parameters
        ----------

        X : Pandas ``DataFrame``
            The Pandas frame to transform. The operation will
            be applied to a copy of the input data, and the result
            will be returned.


        Returns
        -------

        X : Pandas ``DataFrame``
            The operation is applied to a copy of ``X``,
            and the result set is returned.
        """
        check_is_fitted(self, 'fun_')
        X, _ = validate_is_pd(X, self.cols)

# Path: skutil/utils/fixes.py
# def _cols_if_none(X, self_cols):
#     """Since numerous transformers in the preprocessing
#     and feature selection modules take ``cols`` arguments
#     (which could end up as ``None`` via the ``validate_is_pd``
#     method), this will return the columns that should be used.
# 
#     Parameters
#     ----------
# 
#     X : Pandas ``DataFrame``
#         The data frame being transformed.
# 
#     self_cols : list (string) or None
#         The columns.
#     """
#     return X.columns.tolist() if not self_cols else self_cols


# Path: skutil/preprocessing/transform.py
import numpy as np
import pandas as pd
from scipy import optimize
from scipy.stats import boxcox
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.externals import six
from sklearn.externals.joblib import Parallel, delayed
from sklearn.preprocessing import StandardScaler
from sklearn.utils.validation import check_is_fitted
from skutil.base import *
from ..utils import *
from ..utils.fixes import _cols_if_none

        if not hasattr(self.fun_, '__call__'):
            raise TypeError('require callable for interaction_function')

        # validate cols
        if len(cols) < 2:
            raise ValueError('need at least two columns')

        return self

    def transform(self, X):
        """Transform a test matrix given the already-fit transformer.

        Parameters
        ----------

        X : Pandas ``DataFrame``
            The Pandas frame to transform. The operation will
            be applied to a copy of the input data, and the result
            will be returned.


        Returns
        -------

        X : Pandas ``DataFrame``
            The operation is applied to a copy of ``X``,
            and the result set is returned.
        """
        check_is_fitted(self, 'fun_')
        X, _ = validate_is_pd(X, self.cols)

        cols = _cols_if_none(X, self.cols)