8000 rename get_loss_function to _get_loss_function · jwchennlp/scikit-learn@7d0347d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d0347d

Browse files
pprettGaelVaroquaux
authored andcommitted
rename get_loss_function to _get_loss_function
1 parent 237867a commit 7d0347d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/linear_model/stochastic_gradient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _init_t(self, loss_function):
118118
# initialize t such that eta at first sample equals eta0
119119
self.t_ = 1.0 / (eta0 * self.alpha)
120120

121-
def get_loss_function(self, loss):
121+
def _get_loss_function(self, loss):
122122
"""Get concrete ``LossFunction`` object for str ``loss``. """
123123
try:
124124
loss_ = self.loss_functions[loss]
@@ -442,7 +442,7 @@ def _partial_fit(self, X, y, n_iter, classes=None, sample_weight=None,
442442
self._allocate_parameter_mem(n_classes, n_features,
443443
coef_init, intercept_init)
444444

445-
self.loss_function = self.get_loss_function(self.loss)
445+
self.loss_function = self._get_loss_function(self.loss)
446446
if self.t_ is None:
447447
self._init_t(self.loss_function)
448448

@@ -976,7 +976,7 @@ def predict(self, X):
976976
def _fit_regressor(self, X, y, sample_weight, n_iter):
977977
dataset, intercept_decay = _make_dataset(X, y, sample_weight)
978978

979-
loss_function = self.get_loss_function(self.loss)
979+
loss_function = self._get_loss_function(self.loss)
980980
penalty_type = self._get_penalty_type(self.penalty)
981981
learning_rate_type = self._get_learning_rate_type(self.learning_rate)
982982

0 commit comments

Comments
 (0)
0