-
Notifications
You must be signed in to change notification settings - Fork 28.9k
SPARK-22896 Improvement in String interpolation #20070
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
Changes from all commits
9916fd1
162ac27
aa2de00
74d41d7
8d729fa
5507cad
79e6789
70ce734
0321faf
c33e90c
18d047f
e891f53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ object DeveloperApiExample { | |
| // Create a LogisticRegression instance. This instance is an Estimator. | ||
| val lr = new MyLogisticRegression() | ||
| // Print out the parameters, documentation, and any default values. | ||
| println("MyLogisticRegression parameters:\n" + lr.explainParams() + "\n") | ||
| println(s"MyLogisticRegression parameters:\n ${lr.explainParams()}") | ||
|
|
||
| // We may set parameters using setter methods. | ||
| lr.setMaxIter(10) | ||
|
|
@@ -169,10 +169,10 @@ private class MyLogisticRegressionModel( | |
| Vectors.dense(-margin, margin) | ||
| } | ||
|
|
||
| /** Number of classes the label can take. 2 indicates binary classification. */ | ||
| // Number of classes the label can take. 2 indicates binary classification. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, good to make this a standard comment, not scaladoc style
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
| override val numClasses: Int = 2 | ||
|
|
||
| /** Number of features the model was trained on. */ | ||
| // Number of features the model was trained on. | ||
| override val numFeatures: Int = coefficients.size | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ object QuantileDiscretizerExample { | |
| // Output of QuantileDiscretizer for such small datasets can depend on the number of | ||
| // partitions. Here we force a single partition to ensure consistent results. | ||
| // Note this is not necessary for normal use cases | ||
| .repartition(1) | ||
| .repartition(1) | ||
|
|
||
| // $example on$ | ||
| val discretizer = new QuantileDiscretizer() | ||
|
|
@@ -45,7 +45,7 @@ object QuantileDiscretizerExample { | |
| .setNumBuckets(3) | ||
|
|
||
| val result = discretizer.fit(df).transform(df) | ||
| result.show() | ||
| result.show(false) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more question - is it necessary to make this not truncate?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're following same style in other examples so it is good to do.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which other examples? most do not set this, and the Java equivalent doesn't either. If there's a good reason that the output needs to be untruncated, that's fine, just also change the Java example.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srowen correct either way it works for ex. examples/ml/LDAExamples.scala |
||
| // $example off$ | ||
|
|
||
| spark.stop() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is OK; anything more complex I might suggest breaking out the expression into a val.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok