code: def evaluate(self, dataset):
          
          if not isinstance(dataset, DataFrame):
              raise ValueError("dataset must be a DataFrame but got %s." % type(dataset))
          java_lr_summary = self._call_java("evaluate", dataset)
          return LinearRegressionSummary(java_lr_summary)
docs: Evaluates the model on a test dataset.
  
          :param dataset:
            Test dataset to evaluate model on, where dataset is an
            instance of :py:class:`pyspark.sql.DataFrame`