code: def score(self, X, y):
          
          predictions = self.predict(X)
          true = 0.0
          total = 0.0
          for i in range(len(predictions)):
              total += 1
              if predictions[i] == y[i]:
                  true += 1
          return true/total
docs: Calculate accuracy score.
  
          Needed because of bug in metrics.accuracy_score when comparing
          list with numpy array.