@@ -49,6 +49,8 @@ def __init__(
4949 regularize_intercept : None | bool = None ,
5050 constraint_matrix : np .ndarray | None = None ,
5151 constraint_bounds : np .ndarray | None = None ,
52+ beta_lower_bound : np .ndarray | None = None ,
53+ beta_upper_bound : np .ndarray | None = None ,
5254 ):
5355 self .method = method
5456 self .fit_intercept = fit_intercept
@@ -57,6 +59,8 @@ def __init__(
5759 self .forget = forget
5860 self .constraint_matrix = constraint_matrix
5961 self .constraint_bounds = constraint_bounds
62+ self .beta_lower_bound = beta_lower_bound
63+ self .beta_upper_bound = beta_upper_bound
6064
6165 def _fit (
6266 self ,
@@ -128,6 +132,8 @@ def _fit(
128132 is_regularized = is_regularized ,
129133 constraint_matrix = self .remove_problematic_columns (self .constraint_matrix ),
130134 constraint_bounds = self .constraint_bounds ,
135+ beta_lower_bound = self .remove_problematic_columns (self .beta_lower_bound ),
136+ beta_upper_bound = self .remove_problematic_columns (self .beta_upper_bound ),
131137 )
132138 return g , h , coef_ , is_regularized
133139
@@ -192,6 +198,8 @@ def _update(
192198 is_regularized = self ._state .is_regularized ,
193199 constraint_matrix = self .remove_problematic_columns (self .constraint_matrix ),
194200 constraint_bounds = self .constraint_bounds ,
201+ beta_lower_bound = self .remove_problematic_columns (self .beta_lower_bound ),
202+ beta_upper_bound = self .remove_problematic_columns (self .beta_upper_bound ),
195203 )
196204 return g , h , coef_
197205
@@ -211,6 +219,8 @@ def __init__(
211219 regularize_intercept : None | bool = None ,
212220 constraint_matrix : np .ndarray | None = None ,
213221 constraint_bounds : np .ndarray | None = None ,
222+ beta_lower_bound : np .ndarray | None = None ,
223+ beta_upper_bound : np .ndarray | None = None ,
214224 ):
215225 super ().__init__ (
216226 method = method ,
@@ -220,6 +230,8 @@ def __init__(
220230 forget = forget ,
221231 constraint_matrix = constraint_matrix ,
222232 constraint_bounds = constraint_bounds ,
233+ beta_lower_bound = beta_lower_bound ,
234+ beta_upper_bound = beta_upper_bound ,
223235 )
224236 self .features = features
225237
@@ -453,6 +465,8 @@ def __init__(
453465 weighted_regularization : bool = False ,
454466 constraint_matrix : np .ndarray | None = None ,
455467 constraint_bounds : np .ndarray | None = None ,
468+ beta_lower_bound : np .ndarray | None = None ,
469+ beta_upper_bound : np .ndarray | None = None ,
456470 ):
457471 self .fit_intercept = fit_intercept
458472 self .method = method
@@ -463,6 +477,8 @@ def __init__(
463477 self .ic = ic
464478 self .constraint_matrix = constraint_matrix
465479 self .constraint_bounds = constraint_bounds
480+ self .beta_lower_bound = beta_lower_bound
481+ self .beta_upper_bound = beta_upper_bound
466482
467483 def _prepare_term (self ):
468484 self ._method = get_estimation_method (self .method )
@@ -594,6 +610,8 @@ def _fit(
594610 regularization_weights = regularization_weights ,
595611 constraint_bounds = self .constraint_bounds ,
596612 constraint_matrix = self .remove_problematic_columns (self .constraint_matrix ),
613+ beta_lower_bound = self .remove_problematic_columns (self .beta_lower_bound ),
614+ beta_upper_bound = self .remove_problematic_columns (self .beta_upper_bound ),
597615 )
598616
599617 n_observations = y .shape [0 ]
@@ -700,6 +718,8 @@ def _update(
700718 regularization_weights = regularization_weights ,
701719 constraint_bounds = self .constraint_bounds ,
702720 constraint_matrix = self .remove_problematic_columns (self .constraint_matrix ),
721+ beta_lower_bound = self .remove_problematic_columns (self .beta_lower_bound ),
722+ beta_upper_bound = self .remove_problematic_columns (self .beta_upper_bound ),
703723 )
704724 n_observations = self ._state .n_observations + y .shape [0 ]
705725 n_nonzero_coef = np .count_nonzero (coef_path_ , axis = 1 )
0 commit comments