Skip to content

Commit 190ed5a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0a8a6d4 commit 190ed5a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

machine_learning/support_vector_machines.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(
7070
regularization: float = np.inf,
7171
kernel: str = "linear",
7272
gamma: float = 0.0,
73-
degree: float=0.0,
73+
degree: float = 0.0,
7474
coef0: float = 0.0,
7575
) -> None:
7676
self.regularization = regularization
@@ -93,7 +93,7 @@ def __init__(
9393
elif kernel == "polynomial":
9494
if self.degree == 0:
9595
raise ValueError("polynomial kernel requires degree")
96-
if not isinstance(self.degree, (float, int)) :
96+
if not isinstance(self.degree, (float, int)):
9797
raise ValueError("degree must be float or int")
9898
if not self.degree > 0:
9999
raise ValueError("degree must be > 0")
@@ -123,7 +123,6 @@ def __rbf(self, vector1: ndarray, vector2: ndarray) -> float:
123123
"""
124124
return np.exp(-(self.gamma * norm_squared(vector1 - vector2)))
125125

126-
127126
def __polynomial(self, vector1: ndarray, vector2: ndarray) -> float:
128127
"""
129128
Polynomial kernel: (x . y + coef0)^degree

0 commit comments

Comments
 (0)