text_plain_output_1.png image_output_1.png
from sklearn.metrics.classification import accuracy_score, log_loss

import numpy as np

import numpy as np # linear algebra

from sklearn.metrics.classification import accuracy_score, log_loss
cross_validation_size = y_cv.shape[0]
random_cross_validation = np.zeros((cross_validation_size, 9))
for i in range(cross_validation_size):
    random_prob = np.random.rand(1, 9)
    random_cross_validation[i] = (random_prob / sum(sum(random_prob)))[0]
print('log loss for random cross validation is', log_loss(y_cv, random_cross_validation))