Skip to content
Snippets Groups Projects
Commit 6cadc54d authored by Peter Prettenhofer's avatar Peter Prettenhofer
Browse files

set coef_ to fortran layout after fit - this will enhance the test time...

set coef_ to fortran layout after fit - this will enhance the test time performance for predicting singe data points.
parent 954b3900
No related branches found
No related tags found
No related merge requests found
......@@ -249,8 +249,8 @@ class BaseSGD(BaseEstimator):
return sample_weight
def _set_coef(self, coef_):
"""Make sure that coef_ is 2d. """
self.coef_ = array2d(coef_)
"""Make sure that coef_ is fortran-style and 2d. """
self.coef_ = np.asfortranarray(array2d(coef_))
def _allocate_parameter_mem(self, n_classes, n_features, coef_init=None,
intercept_init=None):
......
......@@ -183,6 +183,8 @@ class SGDClassifier(BaseSGDClassifier):
self.coef_[i] = coef
self.intercept_[i] = intercept
self._set_coef(self.coef_)
def _train_ova_classifier(i, c, X, y, coef_, intercept_, loss_function,
penalty_type, alpha, rho, n_iter, fit_intercept,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment