class_docstr: Class that performs the main optimization.
  Keeps track of the current x and iterates through data to learn x given the penalty and order.
class_docstr_tok: ["Class","that","performs","the","main","optimization",".","Keeps","track","of","the","current","x","and","iterates","through","data","to","learn","x","given","the","penalty","and","order","."]
docstr: Returns the weight given to a class for multiclass classification.
docstr_tok: ["Returns","the","weight","given","to","a","class","for","multiclass","classification","."]
code: def _get_scaling_value(self, ysub, target_class):
      """
      Returns the weight given to a class for multiclass classification.
      """
      if self.balanced:
          if self.ordinal:
              return 1 / (torch.unique(ysub).size()[0] - 1)
  
          return 1 / torch.unique(ysub).size()[0]
      else:
          if self.ordinal:
              this_class_proportion = torch.mean(ysub >= target_class)
              normalizing_constant = 0
              for i in range(1, self.n_classes):
                  normalizing_constant += torch.mean(ysub >= i)
              return this_class_proportion / normalizing_constant
          else:
              return torch.mean(ysub == target_class)
  
imports: import time
  import numpy
  import scipy.special
  import torch
  import torch.nn
  from .None import constants
  from .None import syssettings
  from .fginitialize import ChunkDataLoader
label_desc: Use image node_id 7 for calling the Solver obj's underlying member method code with example usage: obj._get_scaling_value(ysub, target_class) and returns: unknown, unknown, unknown, torch