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-10259] [ML] Add @since annotation to ml.classification #8534

Closed
wants to merge 2 commits into from
Closed

[SPARK-10259] [ML] Add @since annotation to ml.classification #8534

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 31, 2015

Add @SInCE annotation to ml.classification

@feynmanliang
Copy link
Contributor

@taishi-oss these were already in spark prior to 1.6, please see the parent JIRA for how to track down the correct version number to use in the @since annotations.

@ghost
Copy link
Author

ghost commented Sep 8, 2015

Sorry for being late.
I modified @SInCE annotations.

@@ -35,6 +35,8 @@ import org.apache.spark.sql.DataFrame
* for classification.
* It supports both binary and multiclass labels, as well as both continuous and categorical
* features.
*
* @since 1.4.0
*/
@Experimental
final class DecisionTreeClassifier(override val uid: String)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also annotate override constructor fields, see ml.KMeans

@feynmanliang
Copy link
Contributor

I only pointed out some issues in the first few files, do you mind fixing them in all the files?

@ghost
Copy link
Author

ghost commented Sep 10, 2015

I'm sorry for taking your time.
I modified the code that was pointed out.

@feynmanliang
Copy link
Contributor

@taishi-oss no worries, thank you for your help! reviewing now

@feynmanliang
Copy link
Contributor

Not all methods in a file were introduced in the same version (e.g. see my comment about DecisionTreeClassifer.copy). Can you make sure that the annotation versions are correct? the jira has directions on how to identify the version a particular method was introduced.

@ghost
Copy link
Author

ghost commented Sep 14, 2015

Sorry, I misunderstood.
I check when all methods were introduced and modify it.
(use SPARK-7751 as a reference.)

If it is not my mistake, DecisionTreeClassifer.copy was introduced in 1.4.1.
And Should I add @SInCE annotation to val?

@feynmanliang
Copy link
Contributor

I believe the copy overrides were added by this commit which went in to 1.5, not 1.4.1. SPARK-7751 has detailed directions on how to use the git history to identify the correct version numbers. You could also look at git blames and histories to figure out the exact commit that introduced it.

you should add annotations to all public methods and constructor parameters (i.e. to vals if they are parameters in a public constructor).

@ghost
Copy link
Author

ghost commented Sep 15, 2015

I think that commit is right.
but "git show" command results as follows.
I also think this is right.

[takahashi@phi spark]$ git show v1.4.0:mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala | grep "override def copy(extra: ParamMap): DecisionTreeClassifier = defaultCopy(extra)"
[takahashi@phi spark]$ git show v1.4.1:mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala | grep "override def copy(extra: ParamMap): DecisionTreeClassifier = defaultCopy(extra)"
  override def copy(extra: ParamMap): DecisionTreeClassifier = defaultCopy(extra)
[takahashi@phi spark]$ git show v1.5.0:mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala | grep "override def copy(extra: ParamMap): DecisionTreeClassifier = defaultCopy(extra)"
  override def copy(extra: ParamMap): DecisionTreeClassifier = defaultCopy(extra)

Which should I believe?

@feynmanliang
Copy link
Contributor

Hmm I actually don't know the answer to that, maybe @mengxr can help

@ghost
Copy link
Author

ghost commented Sep 16, 2015

@mengxr Could you take a look?

Now, I'm adding Since annotation to ml.classification.
I think DecisionTreeClassifer.copy is introduced in this commit (v.1.5.0).
but, "git show" command shows that DecisionTreeClassifer.copy is introduce in v1.4.1.
(Please see above.)

Which version should I add Since annotation to this method?

@ghost
Copy link
Author

ghost commented Sep 17, 2015

I think DecisionTreeClassifer.copy is introduced in v1.5.0.
but, This method is brought into v.1.4.1 using "git-cherry-pick".
So "git blames" says v.1.5.0 but "git show" says v.1.4.1.

I compare "git show" commnad's results with "git blames"'s results in ml.classification, and then there are some differnces as desribed above.

@yu-iskw
Copy link
Contributor

yu-iskw commented Nov 1, 2015

@Hiross thank you for your contribution. Could you update this PR? After that, I could review it.

@yu-iskw
Copy link
Contributor

yu-iskw commented Nov 2, 2015

Jenkins, test this please.

@ghost
Copy link
Author

ghost commented Nov 4, 2015

Sorry for being late.
I rebased this branch.

override val rootNode: Node,
override val numFeatures: Int,
override val numClasses: Int)
@Since("1.5.0")override val uid: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

since 1.4.0

@yu-iskw
Copy link
Contributor

yu-iskw commented Nov 6, 2015

@taishi-oss thanks for rebaseing master. Could you add @Since to all public variables?

@yu-iskw
Copy link
Contributor

yu-iskw commented Nov 12, 2015

ping @taishi-oss

@ghost
Copy link
Author

ghost commented Nov 13, 2015

@yu-iskw Sorry for being late, I'm do right now.

extends ProbabilisticClassifier[Vector, LogisticRegression, LogisticRegressionModel]
with LogisticRegressionParams with DefaultParamsWritable with Logging {

@Since("1.4.0")
Copy link
Member

Choose a reason for hiding this comment

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

1.2.0?

Copy link
Author

Choose a reason for hiding this comment

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

"git show" says it was introduced in v.1.4.0.

hiro [spark] (master) > git show v1.2.0:mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala | grep "def this"   
hiro [spark] (master) > git show v1.3.0:mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala | grep "def this"
hiro [spark] (master) > git show v1.4.0:mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala | grep "def this"
  def this() = this(Identifiable.randomUID("logreg"))

@sarutak
Copy link
Member

sarutak commented Dec 3, 2015

I've left some comments, otherwise it's LGTM but It's good if @jkbradley or @mengxr can take a look at.

@sarutak
Copy link
Member

sarutak commented Dec 3, 2015

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Dec 3, 2015

Test build #47152 has finished for PR 8534 at commit 4e0a925.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * final class DecisionTreeClassifier (\n * final class GBTClassifier(\n * class LogisticRegression(\n * class MultilayerPerceptronClassifier(\n * class NaiveBayes(\n * final class OneVsRest(\n * final class RandomForestClassifier(\n

@SparkQA
Copy link

SparkQA commented Dec 3, 2015

Test build #47153 has finished for PR 8534 at commit 4e0a925.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * final class DecisionTreeClassifier (\n * final class GBTClassifier(\n * class LogisticRegression(\n * class MultilayerPerceptronClassifier(\n * class NaiveBayes(\n * final class OneVsRest(\n * final class RandomForestClassifier(\n

@ghost
Copy link
Author

ghost commented Dec 4, 2015

Thank you for reviewing.
I'm modifying.

@yu-iskw
Copy link
Contributor

yu-iskw commented Dec 4, 2015

@sarutak thank you for your help!

@SparkQA
Copy link

SparkQA commented Dec 4, 2015

Test build #47196 has finished for PR 8534 at commit 3743123.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * final class DecisionTreeClassifier (\n * final class GBTClassifier(\n * class LogisticRegression(\n * class MultilayerPerceptronClassifier(\n * class NaiveBayes(\n * final class OneVsRest(\n * final class RandomForestClassifier(\n

@ghost
Copy link
Author

ghost commented Dec 7, 2015

I modified the code that was pointed out.
@sarutak @yu-iskw Thank you for reviewing!

@SparkQA
Copy link

SparkQA commented Dec 7, 2015

Test build #47260 has finished for PR 8534 at commit 6831e7a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * final class DecisionTreeClassifier @Since(\"1.4.0\") (\n * final class GBTClassifier @Since(\"1.4.0\") (\n * class LogisticRegression @Since(\"1.2.0\") (\n * class MultilayerPerceptronClassifier @Since(\"1.5.0\") (\n * class NaiveBayes @Since(\"1.5.0\") (\n * final class OneVsRest @Since(\"1.4.0\") (\n * final class RandomForestClassifier @Since(\"1.4.0\") (\n * public abstract static class PrefixComputer\n

@mengxr
Copy link
Contributor

mengxr commented Dec 8, 2015

Merged into master and branch-1.6. Thanks!

asfgit pushed a commit that referenced this pull request Dec 8, 2015
Add since annotation to ml.classification

Author: Takahashi Hiroshi <[email protected]>

Closes #8534 from taishi-oss/issue10259.

(cherry picked from commit 7d05a62)
Signed-off-by: Xiangrui Meng <[email protected]>
@asfgit asfgit closed this in 7d05a62 Dec 8, 2015
@ghost
Copy link
Author

ghost commented Dec 8, 2015

Thank you for merging!

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.

5 participants