powered by
The function logl calculates the multiclass cross entropy
logl
logl(y_true, y_pred)
A matrix of multiclass 0/1 indicators
A matrix of predicted probability of each class
The value of multiclass cross entropy
# NOT RUN { data(iris, package = "datasets") Y <- iris[, 5] X <- scale(iris[, 1:4]) pnet <- pnn.fit(x = X, y = Y) logl(y_true = pnet$y.ind, y_pred = pnn.predict(pnet, X)) # }
Run the code above in your browser using DataLab