title: AttributeError: 'LogisticRegressionTrainingSummary' object has no attribute 'areaUnderROC'
body: <p>I want to run area under ROC test for my machine learning model, but the attribute error pops up. Below is my complete code with the error details include. I already have string indexer, one hot encoder and vector assembler on the flight. Please refer to the full code below:</p>
  <pre><code>from pyspark.sql import SparkSession
  import pyspark.sql.functions as F
  import pyspark.sql.types as T
  
  spark = SparkSession.builder.getOrCreate()
      
  df=spark.read.csv(&quot;2018-2010_import.csv&quot;,inferSchema=True,header=True)
      
  train, test = df.randomSplit([0.7, 0.3], seed=7)
      
  print(f&quot;Train set length: {train.count()} records&quot;)
  print(f&quot;Test set length: {test.count()} records&quot;)
  
  train.dtypes
  
  catCols = [x for (x, dataType) in train.dtypes if dataType == &quot;string&quot;]
  numCols = [
      x for (x, dataType) in train.dtypes if ((dataType == &quot;double&quot;) &amp; (x != &quot;HSCode&quot;))
  ]
  
  print(numCols)
  print(catCols)
  
  train.agg(F.countDistinct(&quot;Commodity&quot;,&quot;Country&quot;)).show()
  
  train.groupBy(&quot;Commodity&quot;,&quot;Country&quot;).count().show()
  
  from pyspark.ml.feature import (
      OneHotEncoder,
      StringIndexer,
  )
  
  string_indexer = [
      StringIndexer(inputCol=x, outputCol=x + &quot;_StringIndexer&quot;, handleInvalid=&quot;skip&quot;)
      for x in catCols
  ]
  
  one_hot_encoder = [
      OneHotEncoder(
          inputCols=[f&quot;{x}_StringIndexer&quot; for x in catCols],
          outputCols=[f&quot;{x}_OneHotEncoder&quot; for x in catCols],
      )
  ]
  
  from pyspark.ml.feature import VectorAssembler
  
  assemblerInput = [x for x in numCols]
  assemblerInput += [f&quot;{x}_OneHotEncoder&quot; for x in catCols]
  
  vector_assembler = VectorAssembler(
      inputCols=assemblerInput, outputCol=&quot;VectorAssembler_features&quot;, handleInvalid=&quot;skip&quot;
  )
  
  stages = []
  stages += string_indexer
  stages += one_hot_encoder
  stages += [vector_assembler]
  
  from pyspark.ml import Pipeline
  
  pipeline = Pipeline().setStages(stages)
  model = pipeline.fit(train)
  
  pp_df = model.transform(test)
  
  pp_df.select(
      &quot;HSCode&quot;, &quot;Commodity&quot;, &quot;value&quot;, &quot;Country&quot;, &quot;VectorAssembler_features&quot;,
  ).show(truncate=False)
  from pyspark.ml.classification import LogisticRegression
  
  data = pp_df.select(
      F.col(&quot;VectorAssembler_features&quot;).alias(&quot;features&quot;),
      F.col(&quot;HSCode&quot;).alias(&quot;label&quot;),
  )
  
  model = LogisticRegression().fit(data)
  
  model_summary.areaUnderROC
  </code></pre>
  <hr />
  <p>AttributeError                            Traceback (most recent call last)
  C:\Users\AZMANM~1\AppData\Local\Temp/ipykernel_4856/3039136250.py in 
  ----&gt; 1 model_summary.areaUnderROC
  AttributeError: 'LogisticRegressionTrainingSummary' object has no attribute 'areaUnderROC'</p>
  <pre><code>model.summary.pr.show()
  </code></pre>
  <hr />
  <p>AttributeError                            Traceback (most recent call last)
  C:\Users\AZMANM~1\AppData\Local\Temp/ipykernel_4856/3388404637.py in 
  ----&gt; 1 model.summary.pr.show()</p>
  <p>AttributeError: 'LogisticRegressionTrainingSummary' object has no attribute 'pr'</p>