MAINT Remove -Wsign-compare when compiling sklearn.linear_model._cd_fast
@@ -97,7 +97,7 @@ def enet_coordinate_descent(
floating beta,
floating[::1, :] X,
floating[::1] y,
- int max_iter,
+ unsigned int max_iter,
floating tol,
object rng,
bint random=0,
@@ -283,7 +283,7 @@ def sparse_enet_coordinate_descent(
floating[::1] y,
floating[::1] sample_weight,
floating[::1] X_mean,
- int max_iter,
+ unsigned int max_iter,
floating tol,
object rng,
bint random=0,
@@ -371,6 +371,7 @@ def sparse_enet_coordinate_descent(
cdef UINT32_t* rand_r_state = &rand_r_state_seed
cdef bint center = False
cdef bint no_sample_weights = sample_weight is None
+ cdef int kk
if no_sample_weights:
yw = y
@@ -507,8 +508,8 @@ def sparse_enet_coordinate_descent(
# XtA = X.T @ R - beta * w
for ii in range(n_features):
XtA[ii] = 0.0
- for jj in range(X_indptr[ii], X_indptr[ii + 1]):
- XtA[ii] += X_data[jj] * R[X_indices[jj]]
+ for kk in range(X_indptr[ii], X_indptr[ii + 1]):
+ XtA[ii] += X_data[kk] * R[X_indices[kk]]
if center:
XtA[ii] -= X_mean[ii] * R_sum
@@ -570,7 +571,7 @@ def enet_coordinate_descent_gram(
cnp.ndarray[floating, ndim=2, mode='c'] Q,
cnp.ndarray[floating, ndim=1, mode='c'] q,
cnp.ndarray[floating, ndim=1] y,
- int max_iter,
+ unsigned int max_iter,
floating tol,
object rng,
bint random=0,
@@ -741,7 +742,7 @@ def enet_coordinate_descent_multi_task(
# TODO: use const qualified fused-typed memoryview when Cython 3.0 is used.
cnp.ndarray[floating, ndim=2, mode='fortran'] X,
cnp.ndarray[floating, ndim=2, mode='fortran'] Y,
- int max_iter,
+ unsigned int max_iter,
floating tol,
object rng,
bint random=0
