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

Replace mapValues with immutable Map where applicable #363

Merged
merged 2 commits into from
Jul 11, 2019

Conversation

tovbinm
Copy link
Collaborator

@tovbinm tovbinm commented Jul 11, 2019

Related issues
Fixes #362

Describe the proposed solution
PreparedFeatures.summary should produce immutable map to allow their proper serialization with Spark.

Describe alternatives you've considered
NA

@tovbinm tovbinm requested a review from wsuchy July 11, 2019 16:46
Copy link
Contributor

@wsuchy wsuchy left a comment

Choose a reason for hiding this comment

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

LGTM

@leahmcguire leahmcguire merged commit a53decd into master Jul 11, 2019
@@ -232,10 +232,10 @@ private[op] class OpMultiClassificationEvaluator
ThresholdMetrics(
topNs = topNs,
thresholds = thresholds,
correctCounts = agg.mapValues { case (cor, _) => cor.toSeq },
Copy link
Contributor

@gerashegalov gerashegalov Jul 11, 2019

Choose a reason for hiding this comment

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

nit: just for completeness
one can materialize mapValues view by

agg.mapValues { case (cor, _) => cor.toSeq }.view.toMap

or

agg.transform { case (_, (cor, _)) => cor.toSeq }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Thanks.

@tovbinm tovbinm deleted the mt/ser-mapvalues branch November 26, 2019 05:12
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.

Not serializable exception during computeFeatureStats
4 participants