@@ -58,7 +58,7 @@ class SVC:
5858 Traceback (most recent call last):
5959 ...
6060 ValueError: degree must be float or int
61- >>> SVC(kernel="polynomial",degree=-1)
61+ >>> SVC(kernel="polynomial",degree=-1.0 )
6262 Traceback (most recent call last):
6363 ...
6464 ValueError: degree must be > 0
@@ -70,11 +70,7 @@ def __init__(
7070 regularization : float = np .inf ,
7171 kernel : str = "linear" ,
7272 gamma : float = 0.0 ,
73- << << << < HEAD
74- degree : float = 0.0 ,
75- == == == =
76- degree : int = 0.0 ,
77- >> >> >> > f56f0285a7e96496e47793e3f7c7440d03e61f69
73+ degree : float = 0.0 ,
7874 coef0 : float = 0.0 ,
7975 ) -> None :
8076 self .regularization = regularization
@@ -97,13 +93,8 @@ def __init__(
9793 elif kernel == "polynomial" :
9894 if self .degree == 0 :
9995 raise ValueError ("polynomial kernel requires degree" )
100-
101- if not isinstance (self .degree , (float , int )) :
96+ if not isinstance (self .degree , (float , int )):
10297 raise ValueError ("degree must be float or int" )
103-
104- if not isinstance (self .degree , int ):
105- raise ValueError ("degree must be int" )
106-
10798 if not self .degree > 0 :
10899 raise ValueError ("degree must be > 0" )
109100 self .kernel = self .__polynomial
@@ -253,4 +244,4 @@ def predict(self, observation: ndarray) -> int:
253244if __name__ == "__main__" :
254245 import doctest
255246
256- doctest .testmod ()
247+ doctest .testmod ()
0 commit comments