Skip to content

Commit

Permalink
fix: removed check_array from onedal4py ridge to speed up 5-6 times
Browse files Browse the repository at this point in the history
  • Loading branch information
DDJHB committed Nov 12, 2024
1 parent 4887b8f commit 64bbf53
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions onedal/linear_model/linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ def fit(self, X, y, queue=None):
"""
module = self._get_backend("linear_model", "regression")

X = _check_array(
X,
dtype=[np.float64, np.float32],
force_all_finite=False,
ensure_2d=False,
copy=self.copy_X,
)
if not isinstance(X, np.ndarray):
X = np.asarray(X)

dtype = get_dtype(X)
if dtype not in [np.float32, np.float64]:
dtype = np.float64
X = X.astype(dtype, copy=self.copy_X)

y = np.asarray(y).astype(dtype=get_dtype(X))
y = np.asarray(y).astype(dtype=dtype)

X, y = _check_X_y(X, y, force_all_finite=False, accept_2d_y=True)

Expand Down

0 comments on commit 64bbf53

Please sign in to comment.