Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yj14n9xyz
Copy link
Member

@danyaljj @christos-c Please review this PR.

*
* @param r The desired learning rate value.
* @param r The desired learning rate value.
Copy link
Member

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

Copy link
Member Author

@yj14n9xyz yj14n9xyz Jun 13, 2016

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 {
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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).

Copy link
Member Author

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!

@danyaljj
Copy link
Member

@YimingJiang is this still work in progress?

@yj14n9xyz
Copy link
Member Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants