Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-50899][ML][PYTHON][CONNECT] Support PrefixSpan on connect #49763

Closed

Conversation

zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Support PrefixSpan on connect

Why are the changes needed?

feature parity

Does this PR introduce any user-facing change?

yes

How was this patch tested?

added tests

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

no

@@ -167,3 +170,27 @@ final class PrefixSpan(@Since("2.4.0") override val uid: String) extends Params
override def copy(extra: ParamMap): PrefixSpan = defaultCopy(extra)

}

private[spark] class PrefixSpanWrapper(override val uid: String)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrefixSpan is not a transformer or estimator, add such wrapper so that it can be treated as a transformer on spark connect


head = output.sort("sequence").head()
self.assertEqual(head.sequence, [[1]])
self.assertEqual(head.freq, 3)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrefixSpan doesn't support save/load

@zhengruifeng
Copy link
Contributor Author

zhengruifeng added a commit that referenced this pull request Feb 3, 2025
### What changes were proposed in this pull request?
Support PrefixSpan on connect

### Why are the changes needed?
feature parity

### Does this PR introduce _any_ user-facing change?
yes

### How was this patch tested?
added tests

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

Closes #49763 from zhengruifeng/ml_connect_prefix_span.

Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
(cherry picked from commit f840abb)
Signed-off-by: Ruifeng Zheng <[email protected]>
@zhengruifeng zhengruifeng deleted the ml_connect_prefix_span branch February 3, 2025 02:56
@zhengruifeng
Copy link
Contributor Author

merged to master/4.0

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.

2 participants