Skip to content

Instantly share code, notes, and snippets.

@lucifermorningstar1305
Created July 29, 2022 14:03
Show Gist options
  • Save lucifermorningstar1305/e51a07e4b62e6345eeb3884270167826 to your computer and use it in GitHub Desktop.
Save lucifermorningstar1305/e51a07e4b62e6345eeb3884270167826 to your computer and use it in GitHub Desktop.
Evaluating model performance in Julia
yhat = MLJ.predict(tree, coerce(X[test, :], Continuous))
# To calculate the log-loss or binary cross entropy of our classification algorithm
println("Log-Loss on the Test Set : $(log_loss(yhat, coerce(y[test], Multiclass)) |> mean)")
# To calculate the accuracy of our classification algorithm
println("Accuracy on the Test Set : $(accuracy(mode.(yhat), coerce(y[test], Multiclass)))")
# To generate the Confusion Matrix of our Classification algorithm
ConfusionMatrix()(mode.(yhat), coerce(y[test], Multiclass))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment