<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def score(self, X, y):
 """ Calculate accuracy score. Needed because of bug in metrics.accuracy_score when comparing list with numpy array. """

        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