Skip to content

Commit dc6ae4d

Browse files
authored
Update soft_margin_svm.py
1 parent bc8c535 commit dc6ae4d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

soft_margin_svm/soft_margin_svm.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def gen_lin_separable_data():
119119
y2 = np.ones(len(X2)) * -1
120120
return X1, y1, X2, y2
121121

122-
123122
def gen_non_lin_separable_data():
124123
mean1 = [-1, 2]
125124
mean2 = [1, -1]
@@ -134,7 +133,6 @@ def gen_non_lin_separable_data():
134133
y2 = np.ones(len(X2)) * -1
135134
return X1, y1, X2, y2
136135

137-
138136
def gen_lin_separable_overlap_data():
139137
# generate training data in the 2-d case
140138
mean1 = np.array([0, 2])
@@ -146,7 +144,6 @@ def gen_lin_separable_overlap_data():
146144
y2 = np.ones(len(X2)) * -1
147145
return X1, y1, X2, y2
148146

149-
150147
def split_train(X1, y1, X2, y2):
151148
X1_train = X1[:90]
152149
y1_train = y1[:90]
@@ -156,9 +153,8 @@ def split_train(X1, y1, X2, y2):
156153
y_train = np.hstack((y1_train, y2_train))
157154
return X_train, y_train
158155

159-
160156
def split_test(X1, y1, X2, y2):
161-
X1_test = X1[90:]
157+
X1_test = X1[90:]
162158
y1_test = y1[90:]
163159
X2_test = X2[90:]
164160
y2_test = y2[90:]
@@ -265,4 +261,4 @@ def test_soft():
265261

266262
# test_linear()
267263
# test_non_linear()
268-
test_soft()
264+
test_soft()

0 commit comments

Comments
 (0)