Skip to content

[SPARK-58278][ML][CONNECT] Estimate size of Univariate, ChiSq, Variance selector, and Imputer models#57447

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

[SPARK-58278][ML][CONNECT] Estimate size of Univariate, ChiSq, Variance selector, and Imputer models#57447
zhengruifeng wants to merge 3 commits into
apache:masterfrom
zhengruifeng:feature-selector-stats-size-estimates-dev3

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Adds explicit estimatedSize implementations for UnivariateFeatureSelectorModel, ChiSqSelectorModel, VarianceThresholdSelectorModel, and ImputerModel. The selector models account for their selected-feature arrays; the Imputer model accounts for its column names and surrogate values.

Each model is covered by a fitted-model regression test that asserts the estimate remains below 2 KiB.

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 Univariate, ChiSq, Variance selector, and Imputer models [SPARK-58278][ML][CONNECT] Estimate size of Univariate, ChiSq, Variance selector, and Imputer models Jul 23, 2026
@zhengruifeng
zhengruifeng marked this pull request as ready for review July 23, 2026 02:57
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