Skip to content

fix: support Polars Float32 in cross-validation with finetuning#751

Open
W057 wants to merge 1 commit intoNixtla:mainfrom
W057:fix/issue-635-polars-float32-copy
Open

fix: support Polars Float32 in cross-validation with finetuning#751
W057 wants to merge 1 commit intoNixtla:mainfrom
W057:fix/issue-635-polars-float32-copy

Conversation

@W057
Copy link

@W057 W057 commented Feb 13, 2026

Summary

  • Fixes ValueError when running cross-validation with finetuning on Polars DataFrames with Float32 targets
  • Root cause: Polars Float32 columns produce read-only numpy arrays. np.nan_to_num with copy=False tries to modify them in-place, which fails
  • Fix: change copy=False to copy=True in ensure_contiguous_if_array() (line 897)

As suggested by @jmoralez in #635.

Closes #635

Polars Float32 columns produce read-only numpy arrays when converted.
np.nan_to_num with copy=False attempts in-place modification on these
read-only arrays, causing ValueError during cross-validation with
finetuning.

Closes Nixtla#635
@W057 W057 force-pushed the fix/issue-635-polars-float32-copy branch from 2d76ce7 to e9706eb Compare February 19, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cross-validating + finetuning on Float32 targets on a Polars DataFrame fails

1 participant