Skip to content

[SPARK-11551][DOC][Example]Replace example code in ml-features.md using include_example #10002

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

Closed
wants to merge 13 commits into from

Conversation

somideshmukh
Copy link
Contributor

Made new patch contaning only markdown examples moved to exmaple/folder.
Ony three java code were not shfted since they were contaning compliation error ,these classes are
1)StandardScale 2)NormalizerExample 3)VectorIndexer

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@yinxusen
Copy link
Contributor

Hi @somideshmukh, since it's lots of files in this pull request, I send a pull request to your repo and you can see it here: somideshmukh#1

All of my modifications are there, you can check the code and merge it if it looks good to you. Then we can check the correctness of those newly added files.

@yinxusen
Copy link
Contributor

You can see the files changed in that pull request. I make changes in your original code. The main issues there are:

  • The mismatch between file name and app name
  • The indention in code is not very correct
  • You forget to add // $example on$ and // $example off$ pairs in the code
  • The reorganize of imports

I also add Python files that you missed and 3 Java codes plus with 1 Scala code.

@yinxusen
Copy link
Contributor

Besides, there is no need to create a new pull request every time you changing your code. You can modify your previous code and push the changes in current branch.

for (String ngram : ngrams) System.out.print(ngram + " --- ");
System.out.println();
}
{% include_example java/org/apache/spark/examples/ml/JavaNGramExample.java %}
{% endhighlight %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls remove this line

@yinxusen
Copy link
Contributor

@somideshmukh This is really a bunch of code. I check some errors as described above for my carelessness and sorry for that. And after fixing those errors, I can get it run in my computer. I'll also check the example codes one by one to make sure every code example is runnable without errors.

@yinxusen
Copy link
Contributor

I think the conflict is due to some changes in ml-features.md, but we can leave it for now. After we fix all errors we can fix the conflict.

VectorIndexerModel indexerModel = indexer.fit(data);

Map<Integer, Map<Double, Integer>> categoryMaps = indexerModel.javaCategoryMaps();
System.out.print("Chose " + categoryMaps.size() + "categorical features:");
Copy link
Contributor

Choose a reason for hiding this comment

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

add a white space here " categorical features:", otherwise the output is like this Chose 351categorical features: ...

@somideshmukh
Copy link
Contributor Author

I have made the changes you have mentioned in the given Java and Scala files and push the changes in Branch "SomilBranch1.33". I haven't modified Python files since I haven't work on that files and I donot have python knowledge.

@somideshmukh
Copy link
Contributor Author

Pls check it and let me know whether you have got the changes.

@srowen
Copy link
Member

srowen commented Dec 1, 2015

@somideshmukh the changes are here as you can see, but your branch still needs a rebase.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 1, 2015

@somideshmukh I'll help you change the python issues, then I will send another PR to you soon.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 1, 2015

@somideshmukh I have already fix all issues and merged with master. You can accept my pull request here somideshmukh#2. Even though it looks very large, it can be small when you merging it. I believe we can merge the PR after that.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 2, 2015

@mengxr LGTM

@yinxusen
Copy link
Contributor

yinxusen commented Dec 8, 2015

@mengxr Shall we merge this PR? I find there are also some PRs modify ml-features.md, so I think it's better to merge it before new conflicts emerging.

DataFrame dctDf = dct.transform(df);
dctDf.select("featuresDCT").show(3);
{% endhighlight %}
{% include_example java/org/apache/spark/examples/ml/JavaDCTExample.java %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: remove extra } at the end. You can submit a follow-up PR to fix it.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 8, 2015

@mengxr Yes, I'll submit a follow-up pr to refine it.

@mengxr
Copy link
Contributor

mengxr commented Dec 8, 2015

Merged into master and branch-1.6. Thanks!

@asfgit asfgit closed this in 78209b0 Dec 8, 2015
asfgit pushed a commit that referenced this pull request Dec 8, 2015
…ing include_example

Made new patch contaning only markdown examples moved to exmaple/folder.
Ony three  java code were not shfted since they were contaning compliation error ,these classes are
1)StandardScale 2)NormalizerExample 3)VectorIndexer

Author: Xusen Yin <yinxusen@gmail.com>
Author: somideshmukh <somilde@us.ibm.com>

Closes #10002 from somideshmukh/SomilBranch1.33.

(cherry picked from commit 78209b0)
Signed-off-by: Xiangrui Meng <meng@databricks.com>
@JoshRosen
Copy link
Contributor

Looks like this broke the Python style tests:

PEP8 checks failed.
./examples/src/main/python/ml/binarizer_example.py:41:4: E114 indentation is not a multiple of four (comment)
./examples/src/main/python/ml/onehot_encoder_example.py:39:1: W293 blank line contains whitespace
./examples/src/main/python/ml/pca_example.py:33:9: E128 continuation line under-indented for visual indent
./examples/src/main/python/ml/pca_example.py:35:41: E231 missing whitespace after ','
./examples/src/main/python/ml/polynomial_expansion_example.py:34:9: E128 continuation line under-indented for visual indent
./examples/src/main/python/ml/polynomial_expansion_example.py:35:9: E128 continuation line under-indented for visual indent

I guess that Jenkins never tested this PR?

@liancheng
Copy link
Contributor

Reverting this one to bring back Spark builds.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 8, 2015

Sorry for that, I will help fixing them.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 8, 2015

@somideshmukh I give you another PR to fix the Python style issue: somideshmukh#3. After merging it, we can call jenkins testing once here.

ghost pushed a commit to dbtsai/spark that referenced this pull request Dec 8, 2015
This reverts PR apache#10002, commit 78209b0.

The original PR wasn't tested on Jenkins before being merged.

Author: Cheng Lian <lian@databricks.com>

Closes apache#10200 from liancheng/revert-pr-10002.
asfgit pushed a commit that referenced this pull request Dec 8, 2015
This reverts PR #10002, commit 78209b0.

The original PR wasn't tested on Jenkins before being merged.

Author: Cheng Lian <lian@databricks.com>

Closes #10200 from liancheng/revert-pr-10002.

(cherry picked from commit da2012a)
Signed-off-by: Cheng Lian <lian@databricks.com>
@liancheng
Copy link
Contributor

Hit some network issue, just reverted this PR from master and branch-1.6 in #10200.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 9, 2015

@somideshmukh Do you still have time work on this? Pleas let me know ASAP thanks.

@liancheng
Copy link
Contributor

@yinxusen Maybe you can fork this PR branch and get it merged. You may add a note in your PR description to remind committers to attribute your PR to @somideshmukh. We can specify primary author while merging a PR using our merge script.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 9, 2015

Sure, I will do it

@somideshmukh
Copy link
Contributor Author

Please let me know what needs to be done,I have not worked on python code.

@yinxusen
Copy link
Contributor

yinxusen commented Dec 9, 2015

@somideshmukh Never mind, I add a new one on behalf of you: #10219 @liancheng if it looks good to you, please help me merge it after the Jenkins test. Thanks!

@liancheng
Copy link
Contributor

@yinxusen Well, I'm probably too ignorant to review #10219 :) I'd ping @mengxr to sign it off.

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.

7 participants