0

I am working on pyspark and running model on multi-class classification problem but don't know how to evaluate accuracy of classification model.

This is my code for logistic regression it is also computing time for model.

from pyspark.ml.classification import LogisticRegression    
log_reg = LogisticRegression(featuresCol='features',labelCol='Accident_Severity')   
start = time.perf_counter()    
log_reg.fit(train)    
end = time.perf_counter()    
duration = format((end-start),'.4f')
print("Logistic Regression Time in Seconds :", duration)

Here is a screenshot with my code

lanenok
  • 2,699
  • 17
  • 24

1 Answers1

0

Use MulticlassClassificationEvaluator as described here in the documentation

lanenok
  • 2,699
  • 17
  • 24