July 2018
Intermediate to advanced
474 pages
13h 37m
English
This section walks through the steps to evaluate the model performance.
df_predicted.crosstab('label', 'prediction').show()
Import metrics from sklearn to help measure accuracy using the following script:
from sklearn import metrics
actual = df_predicted.select('label').toPandas()predicted = df_predicted.select('prediction').toPandas()
metrics.accuracy_score(actual, predicted)
Read now
Unlock full access