-
Notifications
You must be signed in to change notification settings - Fork 17
Updated SGD Regression & Classification with user-configurable loss functions #76
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
base: master
Are you sure you want to change the base?
Conversation
* | ||
* @param r The desired learning rate value. | ||
* @param r The desired learning rate value. |
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.
Could you run the formatter plugin?
mvn formater:format
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.
Please see the updated 3 files.
double multiplier = learningRate * (labelValue - wtx); | ||
weightVector.scaledAdd(exampleFeatures, exampleValues, multiplier); | ||
bias += multiplier; | ||
} else { |
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.
hmm ... not sure about this. Hinge loss usually makes more sense in classification problems.
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 can remove the configuration, using hinge loss in SGD classification and lms in SGD regression. Is it better?
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.
That's better.
Even better than that is: having a single SGD which works for both classification and regression, and the user has the option of setting either LMS or Hinge, depending on what they need (classification/regression/etc).
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 can get the first part working soon. The latter may need further deliberation. Thanks!
@YimingJiang is this still work in progress? |
@danyaljj I started working two months ago. Finally working hours are getting better now. I am continuing working on it now. Will get an update soon. |
@danyaljj @christos-c Please review this PR.