Skip to content

Commit bab4e1b

Browse files
authored
Merge pull request #41 from Leona-LYT/main
Fixes issue#39
2 parents 8d2b002 + 47f088a commit bab4e1b

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

rehline/_class.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,17 @@ def fit(self, X, sample_weight=None):
216216
trace_freq=self.trace_freq,
217217
)
218218

219-
self.opt_result_ = result
219+
# self.opt_result_ = result
220220
# primal solution
221-
self.coef_ = result.beta
221+
self.coef_ = result.beta.copy()
222222
# dual solution
223-
self._Lambda = result.Lambda
224-
self._Gamma = result.Gamma
225-
self._xi = result.xi
223+
self._Lambda = result.Lambda.copy()
224+
self._Gamma = result.Gamma.copy()
225+
self._xi = result.xi.copy()
226226
# algo convergence
227227
self.n_iter_ = result.niter
228-
self.dual_obj_ = result.dual_objfns
229-
self.primal_obj_ = result.primal_objfns
228+
self.dual_obj_ = list(result.dual_objfns)
229+
self.primal_obj_ = list(result.primal_objfns)
230230

231231
if self.n_iter_ >= self.max_iter:
232232
warnings.warn(
@@ -447,17 +447,17 @@ def fit(self, X, y, sample_weight=None):
447447
trace_freq=self.trace_freq,
448448
)
449449

450-
self.opt_result_ = result
450+
# self.opt_result_ = result
451451
# primal solution
452-
self.coef_ = result.beta
452+
self.coef_ = result.beta.copy()
453453
# dual solution
454-
self._Lambda = result.Lambda
455-
self._Gamma = result.Gamma
456-
self._xi = result.xi
454+
self._Lambda = result.Lambda.copy()
455+
self._Gamma = result.Gamma.copy()
456+
self._xi = result.xi.copy()
457457
# algo convergence
458458
self.n_iter_ = result.niter
459-
self.dual_obj_ = result.dual_objfns
460-
self.primal_obj_ = result.primal_objfns
459+
self.dual_obj_ = list(result.dual_objfns)
460+
self.primal_obj_ = list(result.primal_objfns)
461461

462462
if self.n_iter_ >= self.max_iter:
463463
warnings.warn(
@@ -699,18 +699,18 @@ def fit(self, X, y, sample_weight=None):
699699
trace_freq=self.trace_freq,
700700
)
701701

702-
self.opt_result_ = result
702+
# self.opt_result_ = result
703703
# primal solution
704-
self.coef_ = result.beta
704+
self.coef_ = result.beta.copy()
705705
# dual solution
706-
self._Lambda = result.Lambda
707-
self._Gamma = result.Gamma
708-
self._xi = result.xi
706+
self._Lambda = result.Lambda.copy()
707+
self._Gamma = result.Gamma.copy()
708+
self._xi = result.xi.copy()
709709
self._mu = result.mu
710710
# algo convergence
711711
self.n_iter_ = result.niter
712-
self.dual_obj_ = result.dual_objfns
713-
self.primal_obj_ = result.primal_objfns
712+
self.dual_obj_ = list(result.dual_objfns)
713+
self.primal_obj_ = list(result.primal_objfns)
714714

715715
if self.n_iter_ >= self.max_iter:
716716
warnings.warn(
@@ -934,18 +934,18 @@ def fit(self, X, y, sample_weight=None):
934934
trace_freq=self.trace_freq,
935935
)
936936

937-
self.opt_result_ = result
937+
# self.opt_result_ = result
938938
# primal solution
939-
self.coef_ = result.beta[:-n_qt]
940-
self.intercept_ = result.beta[-n_qt:]
939+
self.coef_ = result.beta[:-n_qt].copy()
940+
self.intercept_ = result.beta[-n_qt:].copy()
941941
# dual solution
942-
self._Lambda = result.Lambda
943-
self._Gamma = result.Gamma
942+
self._Lambda = result.Lambda.copy()
943+
self._Gamma = result.Gamma.copy()
944944
self._xi = result.xi
945945
# algo convergence
946946
self.n_iter_ = result.niter
947-
self.dual_obj_ = result.dual_objfns
948-
self.primal_obj_ = result.primal_objfns
947+
self.dual_obj_ = list(result.dual_objfns)
948+
self.primal_obj_ = list(result.primal_objfns)
949949

950950
if self.n_iter_ >= self.max_iter:
951951
warnings.warn(

0 commit comments

Comments
 (0)