Commit 8d216c19 authored by YU Xiyue's avatar YU Xiyue
Browse files

linear classification

parent 1b80ee14
......@@ -35,8 +35,9 @@ class LinearClassification:
lc = np.ones([train_features.shape[0], 1])
X = np.concatenate((lc, train_features), axis=1)
N = train_features.shape[1]
for k in range(1, len(set([label[0] for label in train_labels])) + 1):
train_label = linear_label([label[0] for label in train_labels], k)
tl = [label[0] for label in train_labels]
for k in range(1, len(set(tl)) + 1):
train_label = linear_label(tl, k)
w = np.zeros([1, N + 1])
for n in range(self.epochs):
y = np.dot(X, np.transpose(w))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment