Uploaded image for project: 'Apache MADlib'
  1. Apache MADlib
  2. MADLIB-998

Class weights for SVM

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Add a class weight parameter to add weights to specific dependent variable values. This is useful for data with unbalanced classes i.e. situations where 1 class has (far) fewer data points compared to other class(es).

      The general format will be similar to that in scikit-learn, described below:

      class_weight: Sets the weight for the positive and negative classes. If not given, all classes are set to have weight one.

      If class_weight = balanced, values of y are automatically adjusted as inversely proportional to class frequencies in the input data i.e. the weights are set as n_samples / (n_classes * bincount ( y )).
      Alternatively, class_weight can be a mapping, giving the weight for each class.
      Eg. For dependent variable values 'a' and 'b', the class_weight can be

      {a: 2, b: 3}

      . This would lead to each 'a' tuple's y value multiplied by 2 and
      each 'b' y value will be multiplied by 3.

      For regression, the class weights are always one.

      'class_weight' will be part of the optional 'params' argument.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              riyer Rahul Iyer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: