Skip to content

Commit

Permalink
fix a bug for linear coef
Browse files Browse the repository at this point in the history
  • Loading branch information
QinbinLi committed Apr 27, 2019
1 parent a7442a3 commit b04fce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/thundersvm/thundersvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def fit(self, X, y):
thundersvm.get_rho(rho, rho_size, c_void_p(self.model))

if self.kernel == 'linear':
coef = (c_float * (self.n_binary_model * self.n_sv))()
coef = (c_float * (self.n_binary_model * self.n_features))()
thundersvm.get_linear_coef(coef, self.n_binary_model, self.n_features, c_void_p(self.model))
self.coef_ = np.array([coef[index] for index in range(0, self.n_binary_model * self.n_features)]).astype(float)
self.coef_ = np.reshape(self.coef_, (self.n_binary_model, self.n_features))
Expand Down

0 comments on commit b04fce4

Please sign in to comment.