'AttributeError: 'SVM' object has no attribute 'n_iters'
AttributeError
Traceback (most recent call last)
<ipython-input-10-71ceaefd4104> in <module>()
4 #Train the model using the training sets
5 #ml.fit(x_train, y_train)
----> 6 s.fit(x_train, y_train)
7 #Predict the response for test dataset
8 y_pred = s.predict(x_test)
<ipython-input-9-c55e0ec9e040> in fit(self, X, y)
14 self.b = 0
15
---> 16 for _ in range(self.n_iters):
17 for idx, x_i in enumerate(X):
18 condition = y_[idx] * (np.dot(x_i, self.w) - self.b) >= 1
AttributeError: 'SVM' object has no attribute 'n_iters'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
