docstr: This tests a bug fixed by SPARK-18274 which causes multiple copies
  of a Params instance in Python to be linked to the same Java instance.
docstr_tok: ["This","tests","a","bug","fixed","by","SPARK-18274","which","causes","multiple","copies","of","a","Params","instance","in","Python","to","be","linked","to","the","same","Java","instance","."]
code: def test_java_params(self):
      """
      This tests a bug fixed by SPARK-18274 which causes multiple copies
      of a Params instance in Python to be linked to the same Java instance.
      """
      evaluator = RegressionEvaluator(metricName="r2")
      df = self.spark.createDataFrame([Row(label=1.0, prediction=1.1)])
      evaluator.evaluate(df)
      self.assertEqual(evaluator._java_obj.getMetricName(), "r2")
      evaluatorCopy = evaluator.copy({evaluator.metricName: "mae"})
      evaluator.evaluate(df)
      evaluatorCopy.evaluate(df)
      self.assertEqual(evaluator._java_obj.getMetricName(), "r2")
      self.assertEqual(evaluatorCopy._java_obj.getMetricName(), "mae")
  
file_path: spark/python/pyspark/ml/tests/test_evaluation.py
imports: import unittest
  import numpy
  from pyspark.ml.evaluation import ClusteringEvaluator, RegressionEvaluator
  from pyspark.ml.linalg import Vectors
  from pyspark.sql import Row
  from pyspark.testing.mlutils import SparkSessionTestCase
label_desc: Use image node_id 2 for calling the EvaluatorTests obj's underlying member method code with example usage: obj.test_java_params() without return types