title: How to get the log loss?
body: <p>I am playing with the Leaf Classification data set and  I am struggling to compute the log loss of my model after testing it. After importing it from the metrics class here I do:</p>
  <pre><code> # fitting the knn with train-test split 
   X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=42)
   
   # Optimisation via gridSearch
   knn=KNeighborsClassifier()
   params={'n_neighbors': range(1,40), 'weights':['uniform', 'distance'], 'metric':['minkowski','euclidean'],'algorithm': ['auto','ball_tree','kd_tree', 'brute']}
   k_grd=GridSearchCV(estimator=knn,param_grid=params,cv=5)
   k_grd.fit(X_train,y_train)
   
   # testing 
   yk_grd=k_grd.predict(X_test)
  
   # calculating the logloss 
   print (log_loss(y_test, yk_grd))
  </code></pre>
  <p>However, my last line is resulting in the following error:</p>
  <pre><code> y_true and y_pred contain different number of classes 93, 2. Please provide the true labels explicitly through the labels argument. Classes found in y_true.
  </code></pre>
  <p>But the when I run the following:</p>
  <pre><code>X_train.shape, X_test.shape, y_train.shape, y_test.shape, yk_grd.shape
  # results
  ((742, 192), (248, 192), (742,), (248,), (248,))
  </code></pre>
  <p>what am i missing really?</p>