Skip to content

[SPARK-58279][ML][CONNECT] Estimate size of TargetEncoder, VectorIndexer, CountVectorizer, and MinHashLSH models#57448

Open
zhengruifeng wants to merge 3 commits into
apache:masterfrom
zhengruifeng:feature-lookup-size-estimates-dev3
Open

[SPARK-58279][ML][CONNECT] Estimate size of TargetEncoder, VectorIndexer, CountVectorizer, and MinHashLSH models#57448
zhengruifeng wants to merge 3 commits into
apache:masterfrom
zhengruifeng:feature-lookup-size-estimates-dev3

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Adds explicit estimatedSize implementations for TargetEncoderModel, VectorIndexerModel, CountVectorizerModel, and MinHashLSHModel. Each override accounts for model metadata and the model-owned lookup state: encoder statistics, category maps, vocabulary, or random hash coefficients.

Adds fitted-model regression tests in the owning algorithm suites with a 4 KiB upper bound.

Why are the changes needed?

The default reflection-based estimate can traverse substantially more state than the fitted model owns. Direct accounting keeps model-size estimation small, predictable, and focused on the learned state.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 build/sbt 'mllib/Test/compile'\n\n### Was this patch authored or co-authored using generative AI tooling?\n\nGenerated-by: Codex GPT-5

@zhengruifeng zhengruifeng changed the title [WIP][ML] Estimate size of TargetEncoder, VectorIndexer, CountVectorizer, and MinHashLSH models [SPARK-58279][ML] Estimate size of TargetEncoder, VectorIndexer, CountVectorizer, and MinHashLSH models Jul 23, 2026
@zhengruifeng
zhengruifeng marked this pull request as ready for review July 23, 2026 02:07
@zhengruifeng zhengruifeng changed the title [SPARK-58279][ML] Estimate size of TargetEncoder, VectorIndexer, CountVectorizer, and MinHashLSH models [SPARK-58279][ML][CONNECT] Estimate size of TargetEncoder, VectorIndexer, CountVectorizer, and MinHashLSH models Jul 23, 2026
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.

1 participant