Skip to content

[SPARK-45521][ML] Avoid re-computation of nnz in VectorAssembler#43353

Closed
zhengruifeng wants to merge 1 commit intoapache:masterfrom
zhengruifeng:ml_vec_opt
Closed

[SPARK-45521][ML] Avoid re-computation of nnz in VectorAssembler#43353
zhengruifeng wants to merge 1 commit intoapache:masterfrom
zhengruifeng:ml_vec_opt

Conversation

@zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

1, add a new private compressed method with given nnz, since we can know it sometime;
2, minor change Array.range(0, length) -> Iterator.range(0, length) to avoid array creation;

Why are the changes needed?

in VectorAssembler, the nnz if already known before vector construction, the scan to compute nnz can be skipped;

Does this PR introduce any user-facing change?

no

How was this patch tested?

ci

Was this patch authored or co-authored using generative AI tooling?

no

init
@zhengruifeng
Copy link
Contributor Author

thanks, merged to master

@zhengruifeng zhengruifeng deleted the ml_vec_opt branch October 13, 2023 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants