Skip to content

Unbalanced data / weights #9

Description

@pgswartz

Hi Tom et al,
I'm dealing with some pretty unbalanced data and was trying to define the parameters necessary for assigning my own weights. I'm doing the following:

pa = Parameter.new
pa.nr_weight = 2
pos_weight = 1 - clean_positive_train.size/(clean_positive_train.size + clean_negative_train.size)
pa.weight_label([positive_label,negative_label])
pa.weight([pos_weight, 1-pos_weight])

This results in a segmentation fault. I can avoid this segmentation fault by setting nr_weight to 0, but as I understand it, this will mean no weights are assigned (i.e., all classes get weight 1). Could I please ask for your advice on what I'm doing wrong?

Thanks for the awesome library!
Peter

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions