Skip to content
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

Feature to weigh samples differently #87

Open
gowthamnatarajan opened this issue Nov 13, 2017 · 6 comments
Open

Feature to weigh samples differently #87

gowthamnatarajan opened this issue Nov 13, 2017 · 6 comments

Comments

@gowthamnatarajan
Copy link

It would be useful to weight different samples differently. I have to under sample parts of the data because they occur too often. It will be good to just give them more weight rather than have the raw data in the file.

@andresmasegosa
Copy link
Contributor

I agree this is something we also considered at some point. It would not be too difficult to code it for maximum likelihood. Do you dare to do it? :) I could help you out. ;)

@gowthamnatarajan
Copy link
Author

gowthamnatarajan commented Nov 13, 2017

I can do it for MLE. Can you help? I already made some changes to the sampler.

@andresmasegosa
Copy link
Contributor

Yes, sure! Let me think a bit which would be a simple design. But a first question, do you want to provide specific weights for each instance as an extra attribute in your data set?

@gowthamnatarajan
Copy link
Author

Yes, another column with the weights in the ARFF file might be good.

@andresmasegosa
Copy link
Contributor

Hi,

I've been thinking how to do it. I detail my proposal

a) Modify Attributes class to include "WEIGHT" as a special attribute name like "TIME_ID" and "SEQUENCE_ID". When an attribute has this specific name, it will be recognized by AMIDST and will be used to weight the instances when learning.

b) Within "core" module, create a new java class in the learning parametric package (e.g. ParalelMLWeighted). This class should inherit from ParallelMaximulLikelihood. Overwrite the method "double updateModel(DataOnMemory batch)" to account for the weights of the instances. Weight of the instances can be accessed through the special methods created at point (a).

c) Within "core-dynamic" module, create a new java class in the learning parametric package (e.g. ParalelMLWeighted). This class should inherit from ParallelMaximulLikelihood and be based on its counterpart static version created at point b).

I recommend you performing independent pull-requests for each one of these steps.

@gowthamnatarajan
Copy link
Author

Will work on this in 2 weeks when we have to scale up.

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

No branches or pull requests

2 participants