Skip to content

Commit

Permalink
UP my solution
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniloMarinho committed Dec 21, 2023
1 parent 3f10827 commit 33d3d5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sklearn_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ def score(self, X, y):
score : float
Accuracy of the model computed for the (X, y) pairs.
"""

check_classification_targets(y)

y_pred = self.predict(X)

return np.mean(y_pred == y)
Expand Down Expand Up @@ -181,9 +180,9 @@ def get_n_splits(self, X, y=None, groups=None):
first_date, last_date = dates.min(), dates.max()
M_first = 12*first_date.year + first_date.month
M_last = 12*last_date.year + last_date.month

return M_last - M_first

def split(self, X, y, groups=None):
"""Generate indices to split data into training and test set.
Expand Down

0 comments on commit 33d3d5d

Please sign in to comment.