Skip to content

Commit 0316efe

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 761bfd2 commit 0316efe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

machine_learning/scoring_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,32 +138,32 @@ def mbd(predict, actual):
138138
def manual_accuracy(predict, actual):
139139
"""
140140
Calculate the accuracy score for binary classification predictions.
141-
141+
142142
Accuracy = (Number of correct predictions) / (Total predictions)
143-
143+
144144
Parameters:
145145
- predict: Predicted labels
146146
- actual: True labels
147-
147+
148148
Returns:
149149
- float: Accuracy score between 0 and 1
150-
150+
151151
Examples:
152152
>>> actual = [1, 0, 1, 1, 0]
153153
>>> predict = [1, 0, 1, 0, 0]
154154
>>> float(manual_accuracy(predict, actual))
155155
0.8
156-
156+
157157
>>> actual = [1, 1, 1]
158158
>>> predict = [1, 1, 1]
159159
>>> float(manual_accuracy(predict, actual))
160160
1.0
161-
161+
162162
>>> actual = [0, 0, 0]
163163
>>> predict = [1, 1, 1]
164164
>>> float(manual_accuracy(predict, actual))
165165
0.0
166-
166+
167167
>>> actual = [1, 0, 1, 0]
168168
>>> predict = [0, 1, 0, 1]
169169
>>> float(manual_accuracy(predict, actual))

0 commit comments

Comments
 (0)