code: def add_segment(self, name, model_expression=None, ytransform='default'):
          
          if not model_expression:
              if self.default_model_expr is None:
                  raise ValueError(
                      'No default model available, '
                      'you must supply a model experssion.')
              model_expression = self.default_model_expr
  
          if ytransform == 'default':
              ytransform = self.default_ytransform
  
          # no fit or predict filters, we'll take care of that this side.
          self._group.add_model_from_params(
              name, None, None, model_expression, ytransform)
  
          logger.debug('added segment {} to model {}'.format(name, self.name))
docs: Add a new segment with its own model expression and ytransform.
  
          Parameters
          ----------
          name :
              Segment name. Must match a segment in the groupby of the data.
          model_expression : str or dict, optional
              A patsy model expression that can be used with statsmodels.
              Should contain both the left- and right-hand sides.
              If not given the default model will be used, which must not be
              None.
          ytransform : callable, optional
              A function to call on the array of predicted output.
              For example, if the model relation is predicting the log
              of price, you might pass ``ytransform=np.exp`` so that
              the results reflect actual price.
  
              If not given the default ytransform will be used.