code: def json(self):
          
  
          data = {
              "segment_name": self.segment_name,
              "formula": self.formula,
              "warnings": [w.json() for w in self.warnings],
              "model_params": self.model_params,
          }
          return data
docs: Return a JSON-serializable representation of this result.
  
          The output of this function can be converted to a serialized string
          with :any:`json.dumps`.