<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform(self, X):
 """Transform block or partition-wise for dask inputs. For dask inputs, a dask array or dataframe is returned. For other inputs (NumPy array, pandas dataframe, scipy sparse matrix), the regular return value is returned. If the underlying estimator does not have a ``transform`` method, then an ``AttributeError`` is raised. Parameters X : array-like Returns ------- transformed : array-like """

        self._check_method("transform")
        X = self._check_array(X)

        if isinstance(X, da.Array):
            return X.map_blocks(_transform, estimator=self._postfit_estimator)
        elif isinstance(X, dd._Frame):
            return X.map_partitions(_transform, estimator=self._postfit_estimator)
        else:
            return _transform(X, estimator=self._postfit_estimator)