-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[jvm-packages]Adds the ability to pass multiple custom evaluation #3544
Conversation
Additionally, I ran ScalaFmt and google-java-fmt - which passed the XGBoost official style checks, but I am not sure if those meet the standards of XGBoost open source in practice. |
This is great. Does your fork also have watchlist feature for XGBoost4J-Spark? |
3fd3812
to
52c60b4
Compare
would you please avoid changing format in the same PR, though there are some style problems especially for Java code, we may focus on your watch list thing in this PR |
52c60b4
to
51071c2
Compare
@CodingCat I just styled with |
Alternatively, let me know if you guys have a preferred formatter or a more specific ruleset of your linter I should follow. I try to leave as much as possible to linters and formatters style wise. |
I don't think the current linter is checking jvm/* java has no style checker now...scala is using scala-style-check plugin.... |
Do you guys have a style guide then? I'm working on this as a side project, so haven't particularly set up a good dev environment for iterating on this so anything that simplifies my process to follow y'alls ruleset is much appreciated! |
The java did seem to be linting with Checkstyle(that was my motivation for using a formatter), so I just adhered to the linting rules Checkstyle imposed. |
what's the error you received? if you don't change any format, I believe it will not break with stylistic errors (as all the other PRs are successfully passing tests) |
our scala style is essentially a subset (removed some spark related thing) of https://github.com/databricks/scala-style-guide |
I'll just fix these manually. Running the Google Style guide formatter fixes all these Lint issues, but your style guide in practice seems to differ from the linter in that my above changes met lint. Sorry for the inconvenience! |
still confused why all the other PRs didn't touch java can pass lint checker (are you referring to Travis CI's lint checker), but you have such an issue can you just put stylistic issue aside and implement functionalities? or just follow what it says about style manually (as you said)? |
maybe lint works as "check when there is any modification in the directory" since you add a new file there |
cac435e
to
517dcdd
Compare
@CodingCat @hcho3 I don't believe the PR-merge CI errors stem from my changes as it stems from a C error and seems to be affecting a few other open PR's. Am I correct in that? |
@Helw150 Correct, I'm currently looking into it. |
@CodingCat You seem to be the one to look to for review on this one? Whenever you get a chance to review, I'd be super grateful :) |
da154e0
to
bc2620b
Compare
Ping @CodingCat or @hcho3 for review :) |
@Helw150 we are focusing on 0.8 release, will look at it later |
Great, just making sure it made it on your radar. I'll add change |
@CodingCat @hcho3 Just a note, Next week is the last week of the internship where I have been working on adding this functionality as a side project. I would really appreciate it if one of you has a bit of time to review. Sorry to ping again 😓 |
Sorry, No guarantee on that, but we will try....one thing to note is that none of us work on this as full time, instead, we spent time which we squeeze from our daily jobs |
Yup, totally understand as it's the same for me on this PR. Just wanted to make sure it was still on your radar as I had seen new PR's get reviewed and merged as I know it's easy to forget things when they aren't on your roadmap! If it can't get reviewed, no worries. It's living happily on our fork internally, so for our purposes no harm no foul if we can't get this merged. |
@Helw150 We do aim to get all pull requests merged eventually, so that the list doesn't exceed one page. @CodingCat Wish I knew a bit about Scala so that I can help you here. The Java land is still quite new to me hehe |
@hcho3 No worries. I'm in no huge rush as long as it's on your list 👍 |
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.
generally looks good, left some comments and we need to figure out that metricsOut thing
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java
Show resolved
Hide resolved
XGBoostError, | ||
BoosterResults, | ||
IEvaluation | ||
} |
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.
unnecessary multi-lining
evals: Array[IEvaluation] = null, | ||
earlyStoppingRound: Int = 0, | ||
booster: Booster = null | ||
): BoosterResults = { |
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.
consolidate line 45 and 46
jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/XGBoost.scala
Outdated
Show resolved
Hide resolved
obj, | ||
evals, | ||
earlyStoppingRound, | ||
jBooster |
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 don't think you need make one parameter per line
obj, | ||
evals, | ||
earlyStoppingRound, | ||
booster |
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.
unnecessary multi-lining
@@ -52,22 +95,80 @@ object XGBoost { | |||
watches: Map[String, DMatrix] = Map(), | |||
metrics: Array[Array[Float]] = null, | |||
obj: ObjectiveTrait = null, | |||
eval: EvalTrait = null, | |||
eval: IEvaluation = null, |
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.
EvalTrait is not used at all?
@@ -94,11 +195,20 @@ object XGBoost { | |||
nfold: Int = 5, | |||
metrics: Array[String] = null, | |||
obj: ObjectiveTrait = null, | |||
eval: EvalTrait = null): Array[String] = { | |||
eval: EvalTrait = null | |||
): Array[String] = { |
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.
consolidate 198 and 199
obj, | ||
evals, | ||
earlyStoppingRound, | ||
booster |
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.
unnecessary multi-lining
evals: Array[IEvaluation] = null, | ||
earlyStoppingRound: Int = 0, | ||
booster: Booster = null | ||
): Booster = { |
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.
consolidate 157 and 158
any update on this? |
@CodingCat As I said a bit ago, the internship I was working on this as a side project for ended so I don't have nearly as much time to make fixes for the next couple of months. I'll try to make changes based on your comments in the next few weeks, but I don't have any explicit time on my calendar to work on this while at school. |
Please ignore the failed test |
06093e4
to
484d6db
Compare
@CodingCat This should be in a state for you to give another look. I fixed all the issues you had, the primary thing I am uncertain on is how I should handle the one of the lines you said shouldn't have one argument per line. The style guide you linked earlier has the following as it's standard for long method invocations, so for now I've reverted line 54-64 to a single parameter per line to meet the style guide.
|
82799b8
to
5daced5
Compare
Closing as stale |
Putting this here to gain access to the CI. This PR is based off updating and old fork of XGBoost which added this functionality to the current master state, so may have errors from merge conflict.