Uh oh!
There was an error while loading. Please reload this page.
[SPARK-9478] [ml] Add class weights to Random Forest - #9008
[SPARK-9478] [ml] Add class weights to Random Forest#9008rotationsymmetry wants to merge 3 commits into
Conversation
SparkQA
commented
Oct 7, 2015
Test build #43318 has finished for PR 9008 at commit
|
There was a problem hiding this comment.
Should specify return type here.
Is the reason that you can't just modify buildMetadata to accept and RDD[WeightedLabeledPoint] because you are trying not to change MLlib implementation?
There was a problem hiding this comment.
Thank you very much for your comment.
I will add the return type in my next push.
yes, you are right, I don't want to change the mllib impl yet. I will leave it as a TODO after we have a standard way to represent weighted label point.
SparkQA
commented
Oct 9, 2015
Test build #43460 has finished for PR 9008 at commit
|
SparkQA
commented
Oct 9, 2015
Test build #43482 timed out for PR 9008 at commit |
SparkQA
commented
Oct 10, 2015
Test build #43503 has finished for PR 9008 at commit
|
SparkQA
commented
Oct 10, 2015
Test build #43531 timed out for PR 9008 at commit |
SparkQA
commented
Oct 12, 2015
Test build #43553 has finished for PR 9008 at commit
|
rotationsymmetry
commented
Oct 12, 2015
Jenkins failed tests unrelated to this patch. Let's try again. |
SparkQA
commented
Oct 12, 2015
Test build #43572 has finished for PR 9008 at commit
|
SparkQA
commented
Oct 13, 2015
Test build #43588 has finished for PR 9008 at commit
|
rotationsymmetry
commented
Oct 13, 2015
@sethah I have incorporated your comments in the latest patch. Thank you! @jkbradley Do you have any comments or suggestions? Much appreciated. |
SparkQA
commented
Nov 6, 2015
Test build #45206 has finished for PR 9008 at commit
|
rotationsymmetry
commented
Nov 7, 2015
retest this please |
SparkQA
commented
Nov 8, 2015
Test build #45315 has finished for PR 9008 at commit
|
| final class RandomForestClassifier(override val uid: String) | ||
| extends ProbabilisticClassifier[Vector, RandomForestClassifier, RandomForestClassificationModel] | ||
| with RandomForestParams with TreeClassifierParams { | ||
| with RandomForestParams with TreeClassifierParams with HasWeightCol{ |
fabboe
commented
Feb 16, 2016
Thanks for working on this! Minor: PR title says |
| .setStages(Array(labelIndexer, featureIndexer, rf, labelConverter)) | ||
| val model1 = pipeline.fit(dataset) | ||
| val model2 = pipeline.fit(dataset, rf.weightCol->"weight") |
| /** | ||
| * Inject the sample weight to sub-sample weights of the baggedPoints | ||
| */ | ||
| private[impl] def reweightSubSampleWeights( |
There was a problem hiding this comment.
There is a TODO in BaggedPoint.scala for accepting weighted instances. This might be a good time to address that. If not, we will have to implement this in this JIRA, fix Bagged Point in another JIRA, and then return to this, likely in a third JIRA. Thoughts?
sethah
commented
Feb 16, 2016
@rotationsymmetry I made a pass on this, mostly minor comments. Thanks for working on this, it would be great to get it merged in! |
rotationsymmetry
commented
Feb 17, 2016
@sethah Thank you very much for your review. I will incorporate the changes in the next few days. Regarding the TODO in BaggedPoint.scala, I want to look into the details to find out the scope of the change. |
sethah
commented
Feb 23, 2016
I noticed a problem with the current implementation regarding the I checked scikit-learn and they track the actual raw sample counts (unweighted) as well as the sample weights. They use |
sethah
commented
Feb 23, 2016
Another issue is that the information gain for candidate splits is not computed correctly with fractional samples. This is because the information gain calculation here uses the sample counts which are converted to |
sethah
commented
Mar 8, 2016
@rotationsymmetry: Will you have time to work on this? I am more than happy to send a PR to your PR if you do not have time. @jkbradley@dbtsai Would you mind chiming in on the issue mentioned above about minimum instances per node? |
sethah
commented
Mar 18, 2016
cc @MLnick thoughts on the above comments? |
holdenk
commented
Apr 12, 2016
@sethah So to avoid adding any overhead from computing stats for both these params one option would be to selectively compute only the stats that are required (e.g. if they request |
sethah
commented
Apr 14, 2016
@holdenk Thanks for the feedback. Upon some further thought, I think that a.) We need to compute the statistics needed for both I am going to have a PR for this ready soon, which will incorporate changes submitted in this PR. I created two JIRAs for issues that I encountered when preparing this PR and submitted patches for each. They are: |
sethah
commented
Oct 12, 2016
@rotationsymmetry Could you please close this? |
Closesapache#11610Closesapache#15411Closesapache#15501Closesapache#12613Closesapache#12518Closesapache#12026Closesapache#15524Closesapache#12693Closesapache#12358Closesapache#15588Closesapache#15635Closesapache#15678Closesapache#14699Closesapache#9008
Closesapache#11610Closesapache#15411Closesapache#15501Closesapache#12613Closesapache#12518Closesapache#12026Closesapache#15524Closesapache#12693Closesapache#12358Closesapache#15588Closesapache#15635Closesapache#15678Closesapache#14699Closesapache#9008 Author: Sean Owen <sowen@cloudera.com> Closesapache#15685 from srowen/CloseStalePRs.
This PR adds weight support to the following Predictors in ML.
DecisionTreeClassifier
DecisionTreeRegressor
RandomForestClassifier
RandomForestRegressor
cc @jkbradley