r"""
        See also
        --------
        train, transform
351615
def train_transform(self, images, surpress_mapping_check = False):
        
        """
        ret = self.train(images)
        outputs = [self.transform(i, surpress_mapping_check) for i in images]
        return ret, outputs
743606
def fit_transform(self, input, **fit_kwargs):
        """"""
        self.fit(input, **fit_kwargs)
        X = self.transform(input)
        return X
204678
def fit_transform(self, df):
        """"""
        self.index_ = df.index
        self.columns_ = df.columns
        self.cat_columns_ = df.select_dtypes(include=['category']).columns
        self.non_cat_columns_ = df.columns.drop(self.cat_columns_)
        self.cat_map_ = {col: df[col].cat for col in self.cat_columns_}

        # Store all the information about categories/values so we can 'back map' later
        left = len(self.non_cat_columns_)
        self.cat_blocks_ = {}
        for col in self.cat_columns_:
            right = left + len(df[col].cat.categories)
            self.cat_blocks_[col], left = slice(left, right), right

        # This is to ensure that transform always produces the same columns in the same order
        df_with_dummies = pd.get_dummies(df)
        self.columns_in_order = df_with_dummies.columns.tolist()

        # Return the numpy matrix
        return np.asarray(df_with_dummies)
1295597
def transform(self, data):
        
        out = {}
        for key, val in data.items():
            if key in self._transform_map:
                target = self._transform_map[key]
                key, val = target(key, val) if type(target) == types.FunctionType else (key, target)

            out[key] = val


        return out
426620
def transform(self):
        """"""
        ax = self.ax
        return {'axes': ax.transAxes,
                'fig': ax.get_figure().transFigure,
                'data': ax.transData}
638553
def transformed(self, t):
        
        assert t.shape[0] == t.shape[1]
        extra_dimensions = t.shape[0] - self.dimensions - 1

        def transform(a):
            return t.dot(np.concatenate(
                (a, [0] * extra_dimensions, [1]),
                axis=0
            ))[:self.dimensions]
        return Rect(transform(self.mins), transform(self.maxes))
221528
def train(net, X_train, y_train, epochs, verbose_epoch, learning_rate,
          weight_decay, batch_size):
    """"""
    dataset_train = gluon.data.ArrayDataset(X_train, y_train)
    data_iter_train = gluon.data.DataLoader(dataset_train, batch_size,
                                            shuffle=True)
    trainer = gluon.Trainer(net.collect_params(), 'adam',
                            {'learning_rate': learning_rate,
                             'wd': weight_decay})
    net.initialize(force_reinit=True)
    for epoch in range(epochs):
        for data, label in data_iter_train:
            with autograd.record():
                output = net(data)
                loss = square_loss(output, label)
            loss.backward()
            trainer.step(batch_size)
            avg_loss = get_rmse_log(net, X_train, y_train)
        if epoch > verbose_epoch:
            print("Epoch %d, train loss: %f" % (epoch, avg_loss))
    return avg_loss
843611
def transform_data(self, X, test_data=False):
        
        return self.warping_function.f(X, test_data)
195856
def exp_transform(params):
    """"""
    weights = np.exp(np.asarray(params) - np.mean(params))
    return (len(weights) / weights.sum()) * weights
463841
def get_image(self, img, is_train):
        """"""
        img_arr = mx.image.imread(img)
        img_arr = transform(img_arr, 256, 256, is_train, self.boxes[img])
        return img_arr
84046
def train(train_dataset,
          eval_dataset,
          analysis_dir,
          output_dir,
          features,
          layer_sizes,
          max_steps=5000,
          num_epochs=None,
          train_batch_size=100,
          eval_batch_size=16,
          min_eval_frequency=100,
          learning_rate=0.01,
          epsilon=0.0005,
          job_name=None,
          cloud=None,
          ):
  """"""
  job = train_async(
      train_dataset=train_dataset,
      eval_dataset=eval_dataset,
      analysis_dir=analysis_dir,
      output_dir=output_dir,
      features=features,
      layer_sizes=layer_sizes,
      max_steps=max_steps,
      num_epochs=num_epochs,
      train_batch_size=train_batch_size,
      eval_batch_size=eval_batch_size,
      min_eval_frequency=min_eval_frequency,
      learning_rate=learning_rate,
      epsilon=epsilon,
      job_name=job_name,
      cloud=cloud,
  )
  job.wait()
  print('Training: ' + str(job.state))
13762
def transform_data(self, data, request=None, response=None, context=None):
        transform = self.transform
        if hasattr(transform, 'context'):
            self.transform.context = context
        """"""
        if transform and not (isinstance(transform, type) and isinstance(data, transform)):
            if self._params_for_transform:
                return transform(data, **self._arguments(self._params_for_transform, request, response))
            else:
                return transform(data)
        return data
945199
def _prepare_transforms(self):
        """"""
        for offset, value in enumerate(self._config.get(config.TRANSFORMS, [])):
            self._config[config.TRANSFORMS][offset] = self._import_class(value)
1268003
def _transform(self, *transforms):
        
        sequence = None
        for transform in transforms:
            if sequence:
                sequence = Sequence(sequence, transform=transform)
            else:
                sequence = Sequence(self, transform=transform)
        return sequence
934635
def transform(self, X):
        """"""
        # Note: This maps to mean of distribution, we could alternatively
        # sample from Gaussian distribution
        return self.sess.run(self.z_mean, feed_dict={self.x: X})
703080
async def transform(self, file):
		""""""
		file.contents = await self.loop.run_in_executor(self.exe, read_file, file.path)
		return file
161360
def transform(self, df):
        """"""

        # Make sure the dataframe columns are the same as the ones passed to fit
        assert df.columns.equals(self.columns_)

        # Convert the dataframe with get_dummies
        df_with_dummies = pd.get_dummies(df)

        # Make sure our columns exactly match what we stored during the fit operation
        my_columns = set(df_with_dummies.columns.tolist())
        output_column_set = set(self.columns_in_order)
        for column in my_columns.difference(output_column_set):
            print('Deleting extra column {:s}'.format(column))
            del df_with_dummies[column]
        for column in output_column_set.difference(my_columns):
            print('Adding column {:s}'.format(column))
            df_with_dummies[column] = 0

        # Returns the same columns in the same order every time
        return np.asarray(df_with_dummies[self.columns_in_order])