66from ya_glm .cvxpy .penalty import lasso , ridge
77from ya_glm .cvxpy .loss_functions import lin_reg_loss , log_reg_loss ,\
88 quantile_reg_loss
9- from ya_glm .cvxpy .utils import solve_with_backups
9+ # from ya_glm.cvxpy.utils import solve_with_backups
1010from ya_glm .backends .fista .glm_solver import process_param_path
1111
1212
@@ -25,6 +25,7 @@ def solve_glm(X, y,
2525 coef_init = None ,
2626 intercept_init = None ,
2727 zero_tol = 1e-8 ,
28+ solver = None ,
2829 cp_kws = {}):
2930
3031 start_time = time ()
@@ -47,7 +48,8 @@ def solve_glm(X, y,
4748 coef_init = coef_init ,
4849 intercept_init = intercept_init )
4950
50- solve_with_backups (problem = problem , variable = coef , ** cp_kws )
51+ # problem.solve(solver=solver, **cp_kws)
52+ # solve_with_backups(problem=problem, variable=coef, **cp_kws)
5153
5254 if coef .value is None :
5355 raise RuntimeError ("cvxpy solvers failed" )
@@ -63,7 +65,7 @@ def solve_glm(X, y,
6365 return coef , intercept , opt_data
6466
6567
66- def solve_glm_path (fit_intercept = True , cp_kws = {}, zero_tol = 1e-8 ,
68+ def solve_glm_path (fit_intercept = True , solver = None , cp_kws = {}, zero_tol = 1e-8 ,
6769 lasso_pen_seq = None , ridge_pen_seq = None ,
6870 check_decr = True , ** kws ):
6971
@@ -90,7 +92,8 @@ def solve_glm_path(fit_intercept=True, cp_kws={}, zero_tol=1e-8,
9092 if 'ridge_pen' in params :
9193 ridge_pen .value = params ['ridge_pen' ]
9294
93- solve_with_backups (problem = problem , variable = coef , ** cp_kws )
95+ problem .solve (solver = solver , ** cp_kws )
96+ # solve_with_backups(problem=problem, variable=coef, **cp_kws)
9497
9598 if coef .value is None :
9699 raise RuntimeError ("cvxpy solvers failed" )
0 commit comments